##// END OF EJS Templates
scm: git: use the model value of whether reporting last commit in repository tree (#7047)....
Toshi MARUYAMA -
r5537:114e3f3b826c
parent child
Show More
@@ -75,7 +75,9 class Repository::Git < Repository
75 end
75 end
76
76
77 def entries(path=nil, identifier=nil)
77 def entries(path=nil, identifier=nil)
78 scm.entries(path, identifier)
78 scm.entries(path,
79 identifier,
80 options = {:report_last_commit => report_last_commit})
79 end
81 end
80
82
81 # In Git and Mercurial, revisions are not in date order.
83 # In Git and Mercurial, revisions are not in date order.
@@ -22,8 +22,6 module Redmine
22 module Adapters
22 module Adapters
23 class GitAdapter < AbstractAdapter
23 class GitAdapter < AbstractAdapter
24
24
25 SCM_GIT_REPORT_LAST_COMMIT = true
26
27 # Git executable name
25 # Git executable name
28 GIT_BIN = Redmine::Configuration['scm_git_command'] || "git"
26 GIT_BIN = Redmine::Configuration['scm_git_command'] || "git"
29
27
@@ -65,7 +63,6 module Redmine
65 def initialize(url, root_url=nil, login=nil, password=nil, path_encoding=nil)
63 def initialize(url, root_url=nil, login=nil, password=nil, path_encoding=nil)
66 super
64 super
67 @path_encoding = path_encoding.blank? ? 'UTF-8' : path_encoding
65 @path_encoding = path_encoding.blank? ? 'UTF-8' : path_encoding
68 @flag_report_last_commit = SCM_GIT_REPORT_LAST_COMMIT
69 end
66 end
70
67
71 def info
68 def info
@@ -115,17 +112,13 module Redmine
115 Entry.new(:path => '', :kind => 'dir')
112 Entry.new(:path => '', :kind => 'dir')
116 else
113 else
117 # Search for the entry in the parent directory
114 # Search for the entry in the parent directory
118 es = entries_git(search_path, identifier)
115 es = entries(search_path, identifier,
116 options = {:report_last_commit => false})
119 es ? es.detect {|e| e.name == search_name} : nil
117 es ? es.detect {|e| e.name == search_name} : nil
120 end
118 end
121 end
119 end
122
120
123 def entries(path=nil, identifier=nil, options={})
121 def entries(path=nil, identifier=nil, options={})
124 entries_git(path, identifier,
125 {:report_last_commit => @flag_report_last_commit})
126 end
127
128 def entries_git(path=nil, identifier=nil, options={})
129 path ||= ''
122 path ||= ''
130 p = scm_iconv(@path_encoding, 'UTF-8', path)
123 p = scm_iconv(@path_encoding, 'UTF-8', path)
131 entries = Entries.new
124 entries = Entries.new
@@ -160,7 +153,6 module Redmine
160 rescue ScmCommandAborted
153 rescue ScmCommandAborted
161 nil
154 nil
162 end
155 end
163 private :entries_git
164
156
165 def lastrev(path, rev)
157 def lastrev(path, rev)
166 return nil if path.nil?
158 return nil if path.nil?
General Comments 0
You need to be logged in to leave comments. Login now