summaryrefslogtreecommitdiff
path: root/builtin-add.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-08-15 21:12:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-08-15 21:21:23 (GMT)
commita4882c27f8b3793d94b03fd503a0c67ad9772cf6 (patch)
tree6a782d1f7d9a99d666c2120eff56949dfb7779d3 /builtin-add.c
parent93969438dca50c7f0039fcf35e7ab82776d4122f (diff)
downloadgit-a4882c27f8b3793d94b03fd503a0c67ad9772cf6.zip
git-a4882c27f8b3793d94b03fd503a0c67ad9772cf6.tar.gz
git-a4882c27f8b3793d94b03fd503a0c67ad9772cf6.tar.bz2
Fix "git add -u" data corruption.
This applies to 'maint' to fix a rather serious data corruption issue. When "git add -u" affects a subdirectory in such a way that the only changes to its contents are path removals, the next tree object written out of that index was bogus, as the remove codepath forgot to invalidate the cache-tree entry. Reported by Salikh Zakirov. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-add.c')
-rw-r--r--builtin-add.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin-add.c b/builtin-add.c
index 1591171..a5fae7c 100644
--- a/builtin-add.c
+++ b/builtin-add.c
@@ -115,6 +115,7 @@ static void update_callback(struct diff_queue_struct *q,
break;
case DIFF_STATUS_DELETED:
remove_file_from_cache(path);
+ cache_tree_invalidate_path(active_cache_tree, path);
if (verbose)
printf("remove '%s'\n", path);
break;