summaryrefslogtreecommitdiff
path: root/Omni
diff options
context:
space:
mode:
Diffstat (limited to 'Omni')
-rw-r--r--Omni/Agent/Git.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Omni/Agent/Git.hs b/Omni/Agent/Git.hs
index 60e6709..a2009b2 100644
--- a/Omni/Agent/Git.hs
+++ b/Omni/Agent/Git.hs
@@ -178,11 +178,11 @@ commit :: FilePath -> Text -> IO ()
commit repo msg = do
Log.info ["git", "commit", msg]
git repo ["add", "."]
-
+
-- Check for changes before committing to avoid error
let checkCmd = (Process.proc "git" ["diff", "--cached", "--quiet"]) {Process.cwd = Just repo}
(code, _, _) <- Process.readCreateProcessWithExitCode checkCmd ""
-
+
case code of
Exit.ExitSuccess -> Log.warn ["git", "nothing to commit", "skipping"]
Exit.ExitFailure 1 -> git repo ["commit", "-m", Text.unpack msg]