aboutsummaryrefslogtreecommitdiff
path: root/builtin-merge.c
diff options
context:
space:
mode:
authorClemens Buchacher <drizzd@aon.at>2009-06-01 11:20:56 +0200
committerJunio C Hamano <gitster@pobox.com>2009-06-01 19:42:17 -0700
commitc8c562a238071843c64ea0f3a2c85481606da379 (patch)
treec6a892cba320d30eb71b10c96a11c3d77ff731a6 /builtin-merge.c
parent6a01554e6350123c78de805d820e90f1c56e5fdc (diff)
downloadgit-c8c562a238071843c64ea0f3a2c85481606da379.tar.gz
git-c8c562a238071843c64ea0f3a2c85481606da379.tar.xz
refuse to merge during a merge
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>
Diffstat (limited to 'builtin-merge.c')
-rw-r--r--builtin-merge.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin-merge.c b/builtin-merge.c
index 0b58e5eda..9e9bd526c 100644
--- a/builtin-merge.c
+++ b/builtin-merge.c
@@ -836,8 +836,11 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
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