webapp: Display any error message from git init if it fails to create a repository.

This commit is contained in:
Joey Hess 2013-02-26 13:04:37 -04:00
parent 7dfa97ffaf
commit 9d6fd5b927
6 changed files with 56 additions and 36 deletions

View file

@ -276,8 +276,9 @@ startFullAssistant path = do
{- Makes a new git repository. -}
makeRepo :: FilePath -> Bool -> IO ()
makeRepo path bare = do
unlessM (boolSystem "git" params) $
error "git init failed!"
(transcript, ok) <- processTranscript "git" (toCommand params) Nothing
unless ok $
error $ "git init failed!\nOutput:\n" ++ transcript
where
baseparams = [Param "init", Param "--quiet"]
params