repair: Fix handling of git ref names on Windows

Sponsored-by: Kevin Mueller on Patreon
This commit is contained in:
Joey Hess 2023-05-30 16:09:13 -04:00
parent 9ca81ed02a
commit 5070087a63
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 14 additions and 1 deletions

View file

@ -30,6 +30,7 @@ import Git.Types
import Git.Fsck
import Git.Index
import Git.Env
import Git.FilePath
import qualified Git.Config as Config
import qualified Git.Construct as Construct
import qualified Git.LsTree as LsTree
@ -252,7 +253,8 @@ getAllRefs r = getAllRefs' (fromRawFilePath (localGitDir r) </> "refs")
getAllRefs' :: FilePath -> IO [Ref]
getAllRefs' refdir = do
let topsegs = length (splitPath refdir) - 1
let toref = Ref . encodeBS . joinPath . drop topsegs . splitPath
let toref = Ref . toInternalGitPath . encodeBS
. joinPath . drop topsegs . splitPath
map toref <$> dirContentsRecursive refdir
explodePackedRefsFile :: Repo -> IO ()