Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-03-30 08:29:24 +0400
committerJunio C Hamano <gitster@pobox.com>2010-03-30 08:29:24 +0400
commit87b3c0117a340df61bdbac6794611c74696bd42a (patch)
tree94eee7da8ecfda6a4c42ac6ef0902814903f09f6
parent6a6955134b87ba3ea7d54467e637be0da7ba170b (diff)
parent657ab61efa918f46f1b412613643d1a1bbed2194 (diff)
Merge branch 'maint'
* maint: format-patch: Squelch 'fatal: Not a range." error
-rw-r--r--builtin/log.c9
-rwxr-xr-xt/t4014-format-patch.sh4
2 files changed, 12 insertions, 1 deletions
diff --git a/builtin/log.c b/builtin/log.c
index a8dd8c989c..542ecc708b 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -1157,8 +1157,15 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
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");
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index c7b625642d..d21c37f3a2 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -609,4 +609,8 @@ test_expect_success 'format-patch -- <path>' '
! grep "Use .--" error
'
+test_expect_success 'format-patch --ignore-if-in-upstream HEAD' '
+ git format-patch --ignore-if-in-upstream HEAD
+'
+
test_done