diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-05-09 14:11:43 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-05-09 14:12:03 +0900 |
commit | 025206d0dd29266771f166eb4f59609af602213a (patch) | |
tree | 2cd0fa0e361defe24d527ef0705f5e6e8e8a9785 /tool | |
parent | eb84b33c86280a72aaeedae1e582045528c534b2 (diff) | |
download | ruby-025206d0dd29266771f166eb4f59609af602213a.tar.gz |
Fallback to an invalid branch name if no branch found
Diffstat (limited to 'tool')
-rw-r--r-- | tool/vcs.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tool/vcs.rb b/tool/vcs.rb index 1d8fe90a78..be7b672d8c 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]]) |