From 025206d0dd29266771f166eb4f59609af602213a Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 9 May 2019 14:11:43 +0900 Subject: Fallback to an invalid branch name if no branch found --- tool/vcs.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'tool') 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]]) -- cgit v1.2.3