Re: [BUG] 'git mv a/fileA b/fileB' causes 'c/fileC' to be deleted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks.  I see it reproduces.

It is a bug in git-mv that fails to update cache-tree data
structure properly.  This patch should fix it.

-- >8 --
git-mv: do not write out a bogus cache-tree in the index

The command updates the cache without invalidating the cache
tree entries.  Since this is not as performance critical as
one-tree and two-tree git-read-tree and git-apply, disable
use of cache-tree entirely.

Signed-off-by: Junio C Hamano <junkio@xxxxxxx>
---

diff --git a/builtin-mv.c b/builtin-mv.c
index 4d21d88..9a4e2e0 100644
--- a/builtin-mv.c
+++ b/builtin-mv.c
@@ -83,6 +83,9 @@ int cmd_mv(int argc, const char **argv, 
 	if (read_cache() < 0)
 		die("index file corrupt");
 
+	/* This does not manage cache-tree properly */
+	cache_tree_free(&active_cache_tree);
+
 	for (i = 1; i < argc; i++) {
 		const char *arg = argv[i];
 

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]