Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  format-patch: Squelch 'fatal: Not a range." error
  • Loading branch information
Junio C Hamano committed Mar 30, 2010
2 parents 6a69551 + 657ab61 commit 87b3c01
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion builtin/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 4 additions & 0 deletions t/t4014-format-patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 87b3c01

Please sign in to comment.