@matheusbsbs / matheus-bagliano / commits / 9ca8f6079c
Fork 0

"git-merge": allow fast-forwarding in a stat-dirty tree

We used to refresh the index to clear stat-dirtyness before a fast-forward merge. Recent C rewrite forgot to do this. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Aug 20, 2008 at 15:09 UTC 9ca8f6079cdb199851636c719900472a9745885f
2 files changed +11 -1
builtin-merge.c
+1 -1
@@ -566,6 +566,7 @@ static int checkout_fast_forward(unsigned char *head, unsigned char *remote)
566
567 if (read_cache_unmerged())
568 die("you need to resolve your current index first");
569 + refresh_cache(REFRESH_QUIET);
570
571 fd = hold_locked_index(lock_file, 1);
572
@@ -936,7 +937,6 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
937 hex,
938 find_unique_abbrev(remoteheads->item->object.sha1,
939 DEFAULT_ABBREV));
939 - refresh_cache(REFRESH_QUIET);
940 strbuf_init(&msg, 0);
941 strbuf_addstr(&msg, "Fast forward");
942 if (have_message)
t/t7600-merge.sh
+10
@@ -488,4 +488,14 @@ test_expect_success 'merge c1 with c1 and c2' '
488
489 test_debug 'gitk --all'
490
491 +test_expect_success 'merge fast-forward in a dirty tree' '
492 + git reset --hard c0 &&
493 + mv file file1 &&
494 + cat file1 >file &&
495 + rm -f file1 &&
496 + git merge c2
497 +'
498 +
499 +test_debug 'gitk --all'
500 +
501 test_done