summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 25b3d4d)
raw | patch | inline | side by side (parent: 25b3d4d)
author | Junio C Hamano <gitster@pobox.com> | |
Wed, 20 Aug 2008 22:09:28 +0000 (15:09 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 20 Aug 2008 22:49:21 +0000 (15:49 -0700) |
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>
merge. Recent C rewrite forgot to do this.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-merge.c | patch | blob | history | |
t/t7600-merge.sh | patch | blob | history |
diff --git a/builtin-merge.c b/builtin-merge.c
index dde0c7ed33118ff8d0cc421e8a0366e342c6d011..a201c6628d6b2c736e53d69ef75accec7d73b4b6 100644 (file)
--- a/builtin-merge.c
+++ b/builtin-merge.c
if (read_cache_unmerged())
die("you need to resolve your current index first");
+ refresh_cache(REFRESH_QUIET);
fd = hold_locked_index(lock_file, 1);
hex,
find_unique_abbrev(remoteheads->item->object.sha1,
DEFAULT_ABBREV));
- refresh_cache(REFRESH_QUIET);
strbuf_init(&msg, 0);
strbuf_addstr(&msg, "Fast forward");
if (have_message)
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 5eeb6c2b2708d582a6e86cd2e06e2b00b7b7b391..fee8fb77d48ef7d4fa08e77f879718d7ab5b1bc0 100755 (executable)
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
test_debug 'gitk --all'
+test_expect_success 'merge fast-forward in a dirty tree' '
+ git reset --hard c0 &&
+ mv file file1 &&
+ cat file1 >file &&
+ rm -f file1 &&
+ git merge c2
+'
+
+test_debug 'gitk --all'
+
test_done