scm: git: use the model value of whether reporting last commit in repository tree (#7047).
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
This commit is contained in:
parent
03fb61a782
commit
114e3f3b82
|
@ -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.
|
||||
|
|
|
@ -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?
|
||||
|
|
Loading…
Reference in New Issue