summaryrefslogtreecommitdiff
path: root/tool/vcs.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-09 14:11:43 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-09 14:12:03 +0900
commit025206d0dd29266771f166eb4f59609af602213a (patch)
tree2cd0fa0e361defe24d527ef0705f5e6e8e8a9785 /tool/vcs.rb
parenteb84b33c86280a72aaeedae1e582045528c534b2 (diff)
Fallback to an invalid branch name if no branch found
Diffstat (limited to 'tool/vcs.rb')
-rw-r--r--tool/vcs.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/tool/vcs.rb b/tool/vcs.rb
index 1d8fe90..be7b672 100644
--- a/tool/vcs.rb
+++ b/tool/vcs.rb
@@ -403,6 +403,7 @@ class VCS
(branch = branch_list[0]).strip! unless branch_list.empty?
end
branch.chomp!
+ branch = ":detached:" if branch.empty?
upstream = cmd_read_at(srcdir, [gitcmd + %W[branch --list --format=%(upstream:short) #{branch}]])
upstream.chomp!
title = cmd_read_at(srcdir, [gitcmd + %W[log --format=%s -n1 #{upstream}..HEAD]])