more OsPath conversion (650/749)

Sponsored-by: Nicholas Golder-Manning
This commit is contained in:
Joey Hess 2025-02-07 17:03:31 -04:00
parent c74c75b352
commit 5eef09a3cc
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
9 changed files with 79 additions and 78 deletions

View file

@ -9,6 +9,7 @@
module Command.PostReceive where
import Common
import Command
import qualified Annex
import Annex.UpdateInstead
@ -107,12 +108,11 @@ fixPostReceiveHookEnv :: Annex ()
fixPostReceiveHookEnv = do
g <- Annex.gitRepo
case location g of
Local { gitdir = ".", worktree = Just "." } ->
l@(Local {}) | gitdir l == literalOsPath "." && worktree l == Just (literalOsPath ".") ->
Annex.adjustGitRepo $ \g' -> pure $ g'
{ location = case location g' of
loc@(Local {}) -> loc
{ worktree = Just ".." }
{ worktree = Just (literalOsPath "..") }
loc -> loc
}
_ -> noop