scm: git: add flag of disable showing last commit in repository tree (#7047).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4945 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
8bdf73882e
commit
9a8c88ec0a
|
@ -21,6 +21,9 @@ module Redmine
|
||||||
module Scm
|
module Scm
|
||||||
module Adapters
|
module Adapters
|
||||||
class GitAdapter < AbstractAdapter
|
class GitAdapter < AbstractAdapter
|
||||||
|
|
||||||
|
SCM_GIT_REPORT_LAST_COMMIT = true
|
||||||
|
|
||||||
# Git executable name
|
# Git executable name
|
||||||
GIT_BIN = Redmine::Configuration['scm_git_command'] || "git"
|
GIT_BIN = Redmine::Configuration['scm_git_command'] || "git"
|
||||||
|
|
||||||
|
@ -59,6 +62,11 @@ module Redmine
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def initialize(url, root_url=nil, login=nil, password=nil, path_encoding=nil)
|
||||||
|
super
|
||||||
|
@flag_report_last_commit = SCM_GIT_REPORT_LAST_COMMIT
|
||||||
|
end
|
||||||
|
|
||||||
def info
|
def info
|
||||||
begin
|
begin
|
||||||
Info.new(:root_url => url, :lastrev => lastrev('',nil))
|
Info.new(:root_url => url, :lastrev => lastrev('',nil))
|
||||||
|
@ -110,7 +118,7 @@ module Redmine
|
||||||
:path => full_path,
|
:path => full_path,
|
||||||
:kind => (type == "tree") ? 'dir' : 'file',
|
:kind => (type == "tree") ? 'dir' : 'file',
|
||||||
:size => (type == "tree") ? nil : size,
|
:size => (type == "tree") ? nil : size,
|
||||||
:lastrev => lastrev(full_path,identifier)
|
:lastrev => @flag_report_last_commit ? lastrev(full_path,identifier) : Revision.new
|
||||||
}) unless entries.detect{|entry| entry.name == name}
|
}) unless entries.detect{|entry| entry.name == name}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue