diff options
author | Joey Hess <joeyh@joeyh.name> | 2020-08-25 14:57:25 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2020-08-25 14:57:49 -0400 |
commit | 7bdb0cdc0d6f35d3835e57c3a34740cc98f89719 (patch) | |
tree | 17d9dd67a4cf2f5ddbb118988c60642eb04e066c /Upgrade.hs | |
parent | 6b0532e53278bfa992274a4d58fea1eeb671afff (diff) |
add gitAnnexChildProcess and use instead of incorrect use of runsGitAnnexChildProcess
Fixes reversion in 8.20200617 that made annex.pidlock being enabled result
in some commands stalling, particularly those needing to autoinit.
Renamed runsGitAnnexChildProcess to make clearer where it should be
used.
Arguably, it would be better to have a way to make any process git-annex
runs have the env var set. But then it would need to take the pid lock
when running any and all processes, and that would be a problem when
git-annex runs two processes concurrently. So, I'm left doing it ad-hoc
in places where git-annex really does run a child process, directly
or indirectly via a particular git command.
Diffstat (limited to 'Upgrade.hs')
-rw-r--r-- | Upgrade.hs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Upgrade.hs b/Upgrade.hs index 76aac93afe..d9708a0d17 100644 --- a/Upgrade.hs +++ b/Upgrade.hs @@ -15,7 +15,6 @@ import qualified Git import Config import Annex.Path import Annex.Version -import Annex.GitOverlay import Types.RepoVersion #ifndef mingw32_HOST_OS import qualified Upgrade.V0 @@ -104,13 +103,16 @@ upgrade automatic destversion = do -- upgrading a git repo other than the current repo. upgraderemote = do rp <- fromRawFilePath <$> fromRepo Git.repoPath - cmd <- liftIO programPath - runsGitAnnexChildProcess $ liftIO $ boolSystem' cmd - [ Param "upgrade" - , Param "--quiet" - , Param "--autoonly" + gitAnnexChildProcess + [ "upgrade" + , "--quiet" + , "--autoonly" ] (\p -> p { cwd = Just rp }) + (\_ _ _ pid -> waitForProcess pid >>= return . \case + ExitSuccess -> True + _ -> False + ) upgradingRemote :: Annex Bool upgradingRemote = isJust <$> fromRepo Git.remoteName |