Commit Diff


commit - 720b08bca9347796473f8c8c4c6a1f43df62c320
commit + 97f9158ff1c6468a2c80a195ed39dd5ee0ae600d
blob - 93bbe258eca02b2c8f98e5cd8fd66d8888149769
blob + f1730de3eef8aceb312d7ffbd72f6f102611ec16
--- lib/worktree.c
+++ lib/worktree.c
@@ -4590,7 +4590,10 @@ schedule_for_deletion(void *arg, unsigned char status,
 		    strlen(ondisk_path), root_len) != 0);
 	}
 
-	got_fileindex_entry_mark_deleted_from_disk(ie);
+	if (got_fileindex_entry_has_blob(ie))
+		got_fileindex_entry_mark_deleted_from_disk(ie);
+	else
+		got_fileindex_entry_remove(a->fileindex, ie);
 done:
 	free(ondisk_path);
 	if (err)