Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] t/t7001-mv.sh: Propose ability to use git-mv on conflicting entries

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:03

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().
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help