mirror of
https://github.com/git/git
synced 2024-08-29 04:29:22 +00:00
Merge branch 'maint'
* maint: format-patch: Squelch 'fatal: Not a range." error
This commit is contained in:
commit
87b3c0117a
|
@ -1157,8 +1157,15 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ignore_if_in_upstream)
|
if (ignore_if_in_upstream) {
|
||||||
|
/* Don't say anything if head and upstream are the same. */
|
||||||
|
if (rev.pending.nr == 2) {
|
||||||
|
struct object_array_entry *o = rev.pending.objects;
|
||||||
|
if (hashcmp(o[0].item->sha1, o[1].item->sha1) == 0)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
get_patch_ids(&rev, &ids, prefix);
|
get_patch_ids(&rev, &ids, prefix);
|
||||||
|
}
|
||||||
|
|
||||||
if (!use_stdout)
|
if (!use_stdout)
|
||||||
realstdout = xfdopen(xdup(1), "w");
|
realstdout = xfdopen(xdup(1), "w");
|
||||||
|
|
|
@ -609,4 +609,8 @@ test_expect_success 'format-patch -- <path>' '
|
||||||
! grep "Use .--" error
|
! grep "Use .--" error
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'format-patch --ignore-if-in-upstream HEAD' '
|
||||||
|
git format-patch --ignore-if-in-upstream HEAD
|
||||||
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
Loading…
Reference in a new issue