summaryrefslogtreecommitdiff
path: root/Omni/Agent/Git.hs
diff options
context:
space:
mode:
authorOmni Worker <bot@omni.agent>2025-11-21 21:34:55 -0500
committerOmni Worker <bot@omni.agent>2025-11-21 21:34:55 -0500
commit34ab7f0dff803b68863ae143b661ba8ca24e1642 (patch)
treeec812b4c1135261b8aadea50a70987a71028983c /Omni/Agent/Git.hs
parenta08cbd6bef26c138b1cb8089cefe767822d0e494 (diff)
task: sync status
Amp-Thread-ID: https://ampcode.com/threads/T-79499d9e-f4f4-40de-893c-524c32a45483 Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'Omni/Agent/Git.hs')
-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]