It now notices that a RepoLocation may not be Local, in which case
pattern matching on Local wouldn't do.
case location g of
Local { gitdir = ".", worktree = Just "." } ->
Annex.adjustGitRepo $ \g' -> pure $ g'
- { location = (location g')
- { worktree = Just ".." }
+ { location = case location g' of
+ loc@(Local {}) -> loc
+ { worktree = Just ".." }
+ loc -> loc
}
_ -> noop
updateLocation r = return r
updateLocation' :: Repo -> RepoLocation -> IO Repo
-updateLocation' r l = do
+updateLocation' r l@(Local {}) = do
l' <- case getMaybe "core.worktree" r of
Nothing -> return l
Just (ConfigValue d) -> do
return $ l { worktree = Just p }
Just NoConfigValue -> return l
return $ r { location = l' }
+updateLocation' r l = return r { location = l }
data ConfigStyle = ConfigList | ConfigNullList