Junio C Hamano [off-list ref] writes:
quoted
+# Rationale: I cannot git mv around a conflicted file. This is unnecessary
+# restriction in case another part of conflict resolution requires me to
+# move the file around.
Yes, I would agree this is a reasonable thing to support. Something like
this patch, perhaps.
...
Just in case if somebody is inclined to test the patch and polish it into
a shape good enough for inclusion...
quoted hunk
@@ -177,7 +177,8 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
} else
bad = "Cannot overwrite";
}
- } else if (cache_name_pos(src, length) < 0)
+ } else if (((pos = cache_name_pos(src, length)) < 0) &&
+ strcmp(active_cache[-1 - pos]->name, src))
There is a bug here; "-1 - pos" needs to be checked against active_nr
before strcmp().