Community
Participate
Working Groups
Created attachment 276219 [details] Patch to fix CommitCommand to allow setOnly to work on files removed using git rm --cached If CommitCommand is used with setOnly on a file that has been staged for removal, but is still on disk using git rm --cached, the command will error. The error occurs because when setOnly has been used CommitCommand creates a filtered temporary copy of the index by comparing the file tree to the head commit tree without considering whether the file has been removed from the original index. The fix is quite simple and involves just adding a check that the original index tree is not empty before attempting to create a DirCacheEntry in the index copy. Applying the attached patch allows setOnly to work with files that have been staged for removal using git rm.