convert some error to giveup
error has a backtrace, but these are non-internal errors, so a backtrace is unlikely to be useful
This commit is contained in:
parent
ab3c13c021
commit
a62f2e141b
3 changed files with 3 additions and 3 deletions
|
@ -39,7 +39,7 @@ runBool params repo = assertLocal repo $
|
||||||
run :: [CommandParam] -> Repo -> IO ()
|
run :: [CommandParam] -> Repo -> IO ()
|
||||||
run params repo = assertLocal repo $
|
run params repo = assertLocal repo $
|
||||||
unlessM (runBool params repo) $
|
unlessM (runBool params repo) $
|
||||||
error $ "git " ++ show params ++ " failed"
|
giveup $ "git " ++ show params ++ " failed"
|
||||||
|
|
||||||
{- Runs git and forces it to be quiet, throwing an error if it fails. -}
|
{- Runs git and forces it to be quiet, throwing an error if it fails. -}
|
||||||
runQuiet :: [CommandParam] -> Repo -> IO ()
|
runQuiet :: [CommandParam] -> Repo -> IO ()
|
||||||
|
|
|
@ -68,7 +68,7 @@ safeForLsFiles r = isNothing (remoteName r)
|
||||||
guardSafeForLsFiles :: Repo -> IO a -> IO a
|
guardSafeForLsFiles :: Repo -> IO a -> IO a
|
||||||
guardSafeForLsFiles r a
|
guardSafeForLsFiles r a
|
||||||
| safeForLsFiles r = a
|
| safeForLsFiles r = a
|
||||||
| otherwise = error $ "git ls-files is unsafe to run on repository " ++ repoDescribe r
|
| otherwise = giveup $ "git ls-files is unsafe to run on repository " ++ repoDescribe r
|
||||||
|
|
||||||
data Options = ErrorUnmatch
|
data Options = ErrorUnmatch
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ retrieveMissingObjects missing referencerepo r
|
||||||
| not (foundBroken missing) = return missing
|
| not (foundBroken missing) = return missing
|
||||||
| otherwise = withTmpDir "tmprepo" $ \tmpdir -> do
|
| otherwise = withTmpDir "tmprepo" $ \tmpdir -> do
|
||||||
unlessM (boolSystem "git" [Param "init", File tmpdir]) $
|
unlessM (boolSystem "git" [Param "init", File tmpdir]) $
|
||||||
error $ "failed to create temp repository in " ++ tmpdir
|
giveup $ "failed to create temp repository in " ++ tmpdir
|
||||||
tmpr <- Config.read =<< Construct.fromPath (toRawFilePath tmpdir)
|
tmpr <- Config.read =<< Construct.fromPath (toRawFilePath tmpdir)
|
||||||
let repoconfig r' = fromRawFilePath (localGitDir r' P.</> "config")
|
let repoconfig r' = fromRawFilePath (localGitDir r' P.</> "config")
|
||||||
whenM (doesFileExist (repoconfig r)) $
|
whenM (doesFileExist (repoconfig r)) $
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue