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

Omit last_commit=RUBY_LAST_COMMIT_TITLE without local commits

This commit is contained in:
Kazuhiro NISHIYAMA 2019-04-22 21:44:44 +09:00
parent 5da52d1210
commit 87261cf59f
No known key found for this signature in database
GPG key ID: 262ED8DBB4222F7A

View file

@ -383,7 +383,7 @@ class VCS
changed = log[/\Acommit (\h+)/, 1] changed = log[/\Acommit (\h+)/, 1]
modified = log[/^Date:\s+(.*)/, 1] modified = log[/^Date:\s+(.*)/, 1]
branch = cmd_read_at(srcdir, [gitcmd + %W[symbolic-ref HEAD]])[%r'\A(?:refs/heads/)?(.+)', 1] branch = cmd_read_at(srcdir, [gitcmd + %W[symbolic-ref HEAD]])[%r'\A(?:refs/heads/)?(.+)', 1]
title = cmd_read_at(srcdir, [gitcmd + %W[log --format=%s -n1 HEAD]]) title = cmd_read_at(srcdir, [gitcmd + %W[log --format=%s -n1 FETCH_HEAD..HEAD]])
title = nil if title.empty? title = nil if title.empty?
[last, changed, modified, branch, title] [last, changed, modified, branch, title]
end end