Files reported as modified but are binary equal
See original GitHub issueI’m having an issue with Repository.RetrieveStatus()
. It is reporting several files as modified when they are binary equal to what is committed.
There are no local changes.
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
Auto CRLF is set to false. (It is globally set to true
but locally it’s set to false
)
$ git config --local -l
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
core.hidedotfiles=dotGitOnly
core.autocrlf=false
There is no .gitattributes
file.
I’m using LibGit2Sharp 0.21.0.176. The following code shows several files as modified.
var repo = new Repository(path);
var files =
from f in repo.RetrieveStatus()
where f.State != FileStatus.Ignored &&
f.State != FileStatus.Untracked
select f;
foreach (var file in files)
{
Console.WriteLine($"{file.State}\t{file.FilePath}");
}
Why is RetrieveStatus()
reporting modifications when git status
does not?
Let me know if there’s anything I can do to get you any other information you need to help diagnose the problem.
James
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Binary equal files show as modified, unable to revert
I suddenly have a few files that show as modified, but KDiff says they are binary equal. Reverting and discarding those changes does...
Read more >Binary Compare says there are differences when ... - Forums
The Binary compare is accurate. It compares the file bit by bit, even invisible metadata information (which Excel often stores and changes).
Read more >Bug folder compare:Why are some files show binary equal ...
I performed a folder compare of two large folder trees with the Session settings in the attached snapshot. I enabled "Diffs" icon in...
Read more >Git - git-diff Documentation
git-diff - Show changes between commits, commit and working tree, etc ... For binary files, outputs two - instead of saying 0 0...
Read more >filecmp — File and Directory Comparisons
The filecmp module defines functions to compare files and directories, with various optional time/correctness trade-offs. For comparing files, see also the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
autocrlf
is pure evil 👿 . I highly recommend disabling it all together, everywhere and rely on.gitattributes
solely. If your workplace or development team don’t follow, explain to them the error of their ways until they do. 😉That said, @ethomson is likely correct that you were bitten by
autocrlf
during the initial clone. Though, since.gitattributes
is a priority file I am surprised.LibGit2Sharp v0.22 has been released, which includes compatibility with Git 2.x (which uses nanosecond timestamp resolution). This confused us, and we ended up more aggressively examining the working tree for changes, which would show mismatches between configured line endings and the actual files in the repository as changes. This should now be resolved.