Thread (9 messages) flat view 9 messages, 5 authors, 2016-06-15
STALE3737d

[PATCH] refuse to merge during a merge

From: Clemens Buchacher <hidden>
Date: 2016-06-15 22:46:51
Subsystem: the rest · Maintainer: Linus Torvalds

The following is an easy mistake to make for users coming from version
control systems with an "update and commit"-style workflow.

	1. git merge
	2. resolve conflicts
	3. git pull, instead of commit

This overrides MERGE_HEAD, starting a new merge with dirty index. IOW,
probably not what the user intented. Instead, refuse to merge again if a
merge is in progress.

Reported-by: Dave Olszewski <redacted>
Signed-off-by: Clemens Buchacher <redacted>
---

 builtin-merge.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-merge.c b/builtin-merge.c
index 0b58e5e..74a8c8f 100644
--- a/builtin-merge.c
+++ b/builtin-merge.c
@@ -836,7 +836,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 	struct commit_list **remotes = &remoteheads;
 
 	setup_work_tree();
-	if (read_cache_unmerged())
+	if (read_cache_unmerged() || file_exists(git_path("MERGE_HEAD")))
 		die("You are in the middle of a conflicted merge.");
 
 	/*
-- 
1.6.3.1.147.g637c3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help