##// END OF EJS Templates
scm: git: add flag of disable showing last commit in repository tree (#7047)....
Toshi MARUYAMA -
r4825:9a8c88ec0af0
parent child
Show More
@@ -21,6 +21,9 module Redmine
21 module Scm
21 module Scm
22 module Adapters
22 module Adapters
23 class GitAdapter < AbstractAdapter
23 class GitAdapter < AbstractAdapter
24
25 SCM_GIT_REPORT_LAST_COMMIT = true
26
24 # Git executable name
27 # Git executable name
25 GIT_BIN = Redmine::Configuration['scm_git_command'] || "git"
28 GIT_BIN = Redmine::Configuration['scm_git_command'] || "git"
26
29
@@ -59,6 +62,11 module Redmine
59 end
62 end
60 end
63 end
61
64
65 def initialize(url, root_url=nil, login=nil, password=nil, path_encoding=nil)
66 super
67 @flag_report_last_commit = SCM_GIT_REPORT_LAST_COMMIT
68 end
69
62 def info
70 def info
63 begin
71 begin
64 Info.new(:root_url => url, :lastrev => lastrev('',nil))
72 Info.new(:root_url => url, :lastrev => lastrev('',nil))
@@ -110,7 +118,7 module Redmine
110 :path => full_path,
118 :path => full_path,
111 :kind => (type == "tree") ? 'dir' : 'file',
119 :kind => (type == "tree") ? 'dir' : 'file',
112 :size => (type == "tree") ? nil : size,
120 :size => (type == "tree") ? nil : size,
113 :lastrev => lastrev(full_path,identifier)
121 :lastrev => @flag_report_last_commit ? lastrev(full_path,identifier) : Revision.new
114 }) unless entries.detect{|entry| entry.name == name}
122 }) unless entries.detect{|entry| entry.name == name}
115 end
123 end
116 end
124 end
General Comments 0
You need to be logged in to leave comments. Login now