OSDN Git Service

scm: git: use the model value of whether reporting last commit in repository tree...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 5 May 2011 11:43:29 +0000 (11:43 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 5 May 2011 11:43:29 +0000 (11:43 +0000)
And remove entries_git() and the flag in adapter.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5657 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository/git.rb
lib/redmine/scm/adapters/git_adapter.rb

index aa55545..d30ecda 100644 (file)
@@ -75,7 +75,9 @@ class Repository::Git < Repository
   end
 
   def entries(path=nil, identifier=nil)
-    scm.entries(path, identifier)
+    scm.entries(path,
+                identifier,
+                options = {:report_last_commit => report_last_commit})
   end
 
   # In Git and Mercurial, revisions are not in date order.
index 543246a..f064a5e 100644 (file)
@@ -22,8 +22,6 @@ module Redmine
     module Adapters
       class GitAdapter < AbstractAdapter
 
-        SCM_GIT_REPORT_LAST_COMMIT = true
-
         # Git executable name
         GIT_BIN = Redmine::Configuration['scm_git_command'] || "git"
 
@@ -65,7 +63,6 @@ module Redmine
         def initialize(url, root_url=nil, login=nil, password=nil, path_encoding=nil)
           super
           @path_encoding = path_encoding.blank? ? 'UTF-8' : path_encoding
-          @flag_report_last_commit = SCM_GIT_REPORT_LAST_COMMIT
         end
 
         def info
@@ -115,17 +112,13 @@ module Redmine
             Entry.new(:path => '', :kind => 'dir')
           else
             # Search for the entry in the parent directory
-            es = entries_git(search_path, identifier)
+            es = entries(search_path, identifier,
+                         options = {:report_last_commit => false})
             es ? es.detect {|e| e.name == search_name} : nil
           end
         end
 
         def entries(path=nil, identifier=nil, options={})
-          entries_git(path, identifier,
-                      {:report_last_commit => @flag_report_last_commit})
-        end
-
-        def entries_git(path=nil, identifier=nil, options={})
           path ||= ''
           p = scm_iconv(@path_encoding, 'UTF-8', path)
           entries = Entries.new
@@ -160,7 +153,6 @@ module Redmine
         rescue ScmCommandAborted
           nil
         end
-        private :entries_git
 
         def lastrev(path, rev)
           return nil if path.nil?