Commit Diff


commit - c78dbc033c5063cc79ab16426bdae976aa5beb87
commit + f6635657d4d78b75242d294ae26086c05bfa489d
blob - bfdd5fc5f4361a2ce5c55a856b02624a840888f5
blob + a60bbbeee54da16d7504c7439574f7825bf1625a
--- lib/worktree.c
+++ lib/worktree.c
@@ -4593,7 +4593,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)