Is comparing git lfs ls-files with git ls-files ':(attr:filter=lfs)' a reliable way to detect lfs files that are not managed by lfs?
I try to find a way to determine whether the files in git repository are correctly managed by git-lfs. So far, I have found that comparing results from git lfs ls-files and git ls-files ':(attr:filter=lfs)' seems to give me what I want. Add-Type -AssemblyName 'System.Linq'; [string[]] $actualLfsFilePaths = git lfs ls-files | ` ForEach-Object ` { #'12345678 * my.dll' - not all lfs versions support -n flag, so it is better to be conservative $_.Split(' ', 3)[2] }; [string[]] $shouldBeUnderLfsFilePaths = git ls-files ':(attr:filter=lfs)'; $filePathsNotUnderLfs = [System.Linq.Enumerable]::ToArray(