If the user wants to do "git reset" during a merge, the user most likely
wants to do a "git reset --merge". This is especially true during a
merge conflict and the user had local changes, because "git reset" would
leave the merged changes mixed in with the local changes. This makes
"git reset" a little more user-friendly during a merge.
Signed-off-by: Andrew Wong <redacted>
---
builtin/reset.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/builtin/reset.c b/builtin/reset.c
index 6004803..740263d 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -318,7 +318,12 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
_(reset_type_names[reset_type]));
}
if (reset_type == NONE)
- reset_type = MIXED; /* by default */
+ {
+ if(is_merge())
+ reset_type = MERGE;
+ else
+ reset_type = MIXED;
+ }
if (reset_type != SOFT && reset_type != MIXED)
setup_work_tree();--
1.9.0.6.g16e5f9a