Fix bug in last version in getting contents from bare repositories.
This commit is contained in:
parent
bfdc9f28fc
commit
10e8028a42
3 changed files with 10 additions and 5 deletions
|
@ -80,16 +80,15 @@ gitAnnexLocation key r
|
|||
| Git.repoIsLocalBare r =
|
||||
{- Bare repositories default to hashDirLower for new
|
||||
- content, as it's more portable. -}
|
||||
go (Git.workTree r) (annexLocations key)
|
||||
check (map inrepo $ annexLocations key)
|
||||
| otherwise =
|
||||
{- Non-bare repositories only use hashDirMixed, so
|
||||
- don't need to do any work to check if the file is
|
||||
- present. -}
|
||||
return $ Git.workTree r </> ".git" </>
|
||||
annexLocation key hashDirMixed
|
||||
return $ inrepo ".git" </> annexLocation key hashDirMixed
|
||||
where
|
||||
go dir locs = fromMaybe (dir </> head locs) <$> check dir locs
|
||||
check dir = firstM $ \f -> doesFileExist $ dir </> f
|
||||
inrepo = (</>) (Git.workTree r)
|
||||
check locs = fromMaybe (head locs) <$> firstM doesFileExist locs
|
||||
|
||||
{- The annex directory of a repository. -}
|
||||
gitAnnexDir :: Git.Repo -> FilePath
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue