Patch #7829 ยป 0001-Show-branches-through-the-git-branch-command.patch
| app/models/changeset.rb | ||
|---|---|---|
|
:from_path => change[:from_path],
|
||
|
:from_revision => change[:from_revision])
|
||
|
end
|
||
|
|
||
|
def branches
|
||
|
repository.scm.get_branches(scmid)
|
||
|
end
|
||
|
private
|
||
|
# Finds issues that can be referenced by the commit message
|
||
| ... | ... | |
|
return @short_comments, @long_comments
|
||
|
end
|
||
|
def branches
|
||
|
repository.scm.get_branches(scmid)
|
||
|
end
|
||
|
def self.to_utf8(str)
|
||
|
return str if /\A[\r\n\t\x20-\x7e]*\Z/n.match(str) # for us-ascii
|
||
|
encoding = Setting.commit_logs_encoding.to_s.strip
|
||
| lib/redmine/scm/adapters/git_adapter.rb | ||
|---|---|---|
|
def get_branches(scmid)
|
||
|
result = []
|
||
|
branches.each do |branch|
|
||
|
cmd = "#{GIT_BIN} --git-dir #{target('')} log --pretty=oneline #{branch}"
|
||
|
shellout(cmd) do |io|
|
||
|
io.each_line do |line|
|
||
|
if line.include?(scmid)
|
||
|
result << branch
|
||
|
break
|
||
|
end
|
||
|
end
|
||
|
cmd = "#{GIT_BIN} --git-dir #{target('')} branch --no-color --contains #{scmid}"
|
||
|
shellout(cmd) do |io|
|
||
|
io.each_line do |line|
|
||
|
line = line[1..-1] if line =~ /^\*/ # current branch marked by star
|
||
|
result << line.strip
|
||
|
end
|
||
|
end
|
||
|
result.uniq
|
||
|
result.sort!
|
||
|
end
|
||
|
def tags
|
||