mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-25 10:54:52 +01:00
nmbug: Handle missing @upstream in is_unmerged
If we don't have an upstream, there is nothing to merge, so nothing is unmerged. This avoids errors like: $ nmbug status error: No upstream configured for branch 'master' error: No upstream configured for branch 'master' fatal: ambiguous argument '@{upstream}': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' 'git rev-parse @{upstream}' exited with nonzero value You might not have an upstream if you're only using nmbug locally to version-control your tags.
This commit is contained in:
parent
c2bbe9eb6c
commit
567aab405b
1 changed files with 4 additions and 1 deletions
|
@ -430,7 +430,10 @@ sub do_status {
|
|||
sub is_unmerged {
|
||||
my $commit = shift || '@{upstream}';
|
||||
|
||||
my $fetch_head = git ('rev-parse', $commit);
|
||||
my ($fetch_head, $status) = git_with_status ('rev-parse', $commit);
|
||||
if ($status) {
|
||||
return 0;
|
||||
}
|
||||
my $base = git ( 'merge-base', 'HEAD', $commit);
|
||||
|
||||
return ($base ne $fetch_head);
|
||||
|
|
Loading…
Reference in a new issue