Signed-off-by: Felipe Contreras <[email protected]>
---
git-request-pull.rb | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/git-request-pull.rb b/git-request-pull.rb
index 416f880..0f85024 100755
--- a/git-request-pull.rb
+++ b/git-request-pull.rb
@@ -14,6 +14,13 @@ EOF
exit 1
end
+def read_branch_desc(name)
+ git_config() do |key, value|
+ return value if key == "branch.#{name}.description"
+ end
+ return nil
+end
+
def abbr(ref)
if (ref =~ %r{^refs/heads/(.*)} || ref =~ %r{^refs/(tags/.*)})
return $1
@@ -70,8 +77,8 @@ _, _, headref = dwim_ref(head)
if headref.start_with?('refs/heads')
branch_name = headref[11..-1]
- branch_desc = `git config "branch.#{branch_name}.description"`.chomp
- branch_name = nil if branch_desc.empty?
+ branch_desc = read_branch_desc(branch_name)
+ branch_name = nil if not branch_desc
end
tag_name = `git describe --exact "#{head}^0" 2>/dev/null`.chomp
--
1.8.4-fc
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html