When viewing my repository status with Git Bash I can see many files that are marked as 'Deleted'. LibGit2Sharp RepositoryStatus reports these files as "Missing". The RepositoryStatus object also has a collection "Removed".
What is the difference between these two? Should deleted files not be marked as "Removed"?
So what is the difference between these two?
Missing and Removed are entries of the FileStatus enumeration.
As stated by the xml documentation
Missing means "The file has been deleted from the working directory. A previous version exists in the Index."
Removed means "The deletion of a file has been promoted from the working directory to the Index. A previous version exists in the Head."
They can be seen as specific states of a file lifecycle. Let's consider a file which exists in the working directory, in the index and in the Head. Its status is Unaltered.
When being suppressed from the working directory (ie. deleted from the filesystem), the status of the file turns into Missing
If now, one stages the suppression of the file, it disappears from the Index and the status becomes Removed
Should deleted files not be marked as, "Removed"?
Git uses the same word deleted to describe the two states. However, there are some visual clues to let you disambiguate them.
When running git status
Missing files are being listed under the Changes not staged for commit:
section and the deleted word is colored in red
Removed files are being listed under the Changes to be committed:
section and the deleted word is colored in green