Commit Diff
- Commit:
f6635657d4d78b75242d294ae26086c05bfa489d
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
- Message:
- fix deletion of missing locally-added files If a locally added file in A status gets deleted from disk it will move into missing ! status. If the user then decides to delete the file we must remove the file index entry immediately rather than flagging the file for removal during the next commit operation. The file was never committed and lacks a base-blob and base-commit, so it cannot be removed during the next commit. As a result the commit operation was reporting a bogus "out of date" error. Found while diagnosing a related bug reported by gonzalo@ ok op@
- Actions:
- Patch | Tree
--- 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)