summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6a01554)
raw | patch | inline | side by side (parent: 6a01554)
author | Clemens Buchacher <drizzd@aon.at> | |
Mon, 1 Jun 2009 09:20:56 +0000 (11:20 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 2 Jun 2009 02:42:17 +0000 (19:42 -0700) |
The following is an easy mistake to make for users coming from version
control systems with an "update and commit"-style workflow.
1. git pull
2. resolve conflicts
3. git pull
Step 3 overrides MERGE_HEAD, starting a new merge with dirty index.
IOW, probably not what the user intended. Instead, refuse to merge
again if a merge is in progress.
Reported-by: Dave Olszewski <cxreg@pobox.com>
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
control systems with an "update and commit"-style workflow.
1. git pull
2. resolve conflicts
3. git pull
Step 3 overrides MERGE_HEAD, starting a new merge with dirty index.
IOW, probably not what the user intended. Instead, refuse to merge
again if a merge is in progress.
Reported-by: Dave Olszewski <cxreg@pobox.com>
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-merge.c | patch | blob | history | |
t/t3030-merge-recursive.sh | patch | blob | history |
diff --git a/builtin-merge.c b/builtin-merge.c
index 0b58e5eda1f38c1560cc9dcf69be37fa5fc9886f..9e9bd526c39e25b257733a575e8c690ed494f214 100644 (file)
--- a/builtin-merge.c
+++ b/builtin-merge.c
struct commit_list **remotes = &remoteheads;
setup_work_tree();
+ if (file_exists(git_path("MERGE_HEAD")))
+ die("You have not concluded your merge. (MERGE_HEAD exists)");
if (read_cache_unmerged())
- die("You are in the middle of a conflicted merge.");
+ die("You are in the middle of a conflicted merge."
+ " (index unmerged)");
/*
* Check if we are _not_ on a detached HEAD, i.e. if there is a
index 0de613dc53d85c01f6d122834e094503a2736507..9b3fa2bdcd9bebae46a000ffe9c2059cea5a93fd 100755 (executable)
test_must_fail git merge "$c5" &&
test_must_fail git merge "$c5" 2> out &&
+ grep "You have not concluded your merge" out &&
+ rm -f .git/MERGE_HEAD &&
+ test_must_fail git merge "$c5" 2> out &&
grep "You are in the middle of a conflicted merge" out
'