1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fallback to an invalid branch name if no branch found

This commit is contained in:
Nobuyoshi Nakada 2019-05-09 14:11:43 +09:00
parent eb84b33c86
commit 025206d0dd
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -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]])