summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e07665e)
raw | patch | inline | side by side (parent: e07665e)
author | Kevin Ballard <kevin@sb.org> | |
Tue, 30 Mar 2010 02:46:38 +0000 (19:46 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 30 Mar 2010 04:22:37 +0000 (21:22 -0700) |
Don't output an error on `git format-patch --ignore-if-in-upstream HEAD`.
This matches the behavior of `git format-patch HEAD`.
Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This matches the behavior of `git format-patch HEAD`.
Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-log.c | patch | blob | history | |
t/t4014-format-patch.sh | patch | blob | history |
diff --git a/builtin-log.c b/builtin-log.c
index e0d5caa61bac72cb40272ab26aa9b2202d5bb3e8..76962e1b08ec6a7e52320c97cc3b54887cc67ef9 100644 (file)
--- a/builtin-log.c
+++ b/builtin-log.c
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);
+ }
if (!use_stdout)
realstdout = xfdopen(xdup(1), "w");
index f2a2aaa2b9c7fd84634bb74febb3f0f5ac1793e1..843ef7f88c3025ebe0660a645024fcf0942386bd 100755 (executable)
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
! grep "Use .--" error
'
+test_expect_success 'format-patch --ignore-if-in-upstream HEAD' '
+ git format-patch --ignore-if-in-upstream HEAD
+'
+
test_done