From d7e273729a791b1958ca8d24ae5e6492ea94fcc8 Mon Sep 17 00:00:00 2001 From: mrkkrp Date: Thu, 10 Dec 2015 18:33:37 +0600 Subject: [PATCH] Show a message when resetting git commit fails See #1453. --- src/Stack/Config.hs | 3 ++- src/System/Process/Read.hs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Stack/Config.hs b/src/Stack/Config.hs index 191530905c..f219584d81 100644 --- a/src/Stack/Config.hs +++ b/src/Stack/Config.hs @@ -477,7 +477,8 @@ resolvePackageLocation menv projRoot (PLRemote url remotePackageType) = do Nothing readInNull dirTmp commandName menv (resetCommand ++ [T.unpack commit]) - Nothing + (Just $ "Please ensure that commit " <> commit <> + " exists within " <> url) case remotePackageType of RPTHttpTarball -> do diff --git a/src/System/Process/Read.hs b/src/System/Process/Read.hs index 6d0e6e17e0..22d1ec2fbf 100644 --- a/src/System/Process/Read.hs +++ b/src/System/Process/Read.hs @@ -141,7 +141,7 @@ readProcessNull wd menv name args = sinkProcessStdout wd menv name args CL.sinkNull -- | Run the given command in the given directory. If it exits with anything --- but success, prints an error and then calls 'exitWith' to exit the program. +-- but success, print an error and then call 'exitWith' to exit the program. readInNull :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => Path Abs Dir -- ^ Directory to run in -> FilePath -- ^ Command to run