@@ -72,7 +72,8 @@ def test_path_limited_stash_keeps_staged_deletions_and_renames(
7272 """A selected staged deletion or rename stashes without taking unrelated run edits."""
7373 _init_repo (tmp_path )
7474 (tmp_path / "run [work].py" ).write_text ("x = 1\n " , encoding = "utf-8" )
75- git_ops .commit_all (tmp_path , "track run file" )
75+ subprocess .run (["git" , "-C" , str (tmp_path ), "add" , "-A" ], check = True )
76+ subprocess .run (["git" , "-C" , str (tmp_path ), "commit" , "-q" , "-m" , "track run file" ], check = True )
7677 (tmp_path / "run [work].py" ).write_text ("x = 5\n " , encoding = "utf-8" )
7778 (tmp_path / "notes.txt" ).write_text ("operator notes\n " , encoding = "utf-8" )
7879 selected = {"README.md" }
@@ -168,7 +169,8 @@ def test_git_ops_neutralizes_repo_fsmonitor(tmp_path: pathlib.Path) -> None:
168169 (tmp_path / "new.txt" ).write_text ("x\n " , encoding = "utf-8" )
169170 # Index-refreshing op through agent6's hardened command runner.
170171 git_read .status (tmp_path )
171- git_ops .commit_all (tmp_path , "msg" )
172+ git_command .run (tmp_path , "add" , "-A" )
173+ git_command .run (tmp_path , "commit" , "-m" , "msg" )
172174 assert not marker .exists (), "repo core.fsmonitor command executed on the host"
173175
174176
@@ -193,7 +195,8 @@ def test_git_ops_skips_repo_hooks_by_default(tmp_path: pathlib.Path) -> None:
193195 marker = tmp_path / "HOOK_FIRED"
194196 _add_pre_commit_hook (tmp_path , marker )
195197 (tmp_path / "n.txt" ).write_text ("x\n " , encoding = "utf-8" )
196- git_ops .commit_all (tmp_path , "c" ) # no set_repo_hook_policy call: the default governs
198+ git_command .run (tmp_path , "add" , "-A" )
199+ git_command .run (tmp_path , "commit" , "-m" , "c" ) # no set_repo_hook_policy: the default governs
197200 assert not marker .exists ()
198201
199202
@@ -204,7 +207,8 @@ def test_git_ops_runs_repo_hooks_when_enabled(tmp_path: pathlib.Path) -> None:
204207 (tmp_path / "n.txt" ).write_text ("x\n " , encoding = "utf-8" )
205208 try :
206209 git_policy .set_repo_hook_policy (True ) # git.run_repo_hooks = true
207- git_ops .commit_all (tmp_path , "c" )
210+ git_command .run (tmp_path , "add" , "-A" )
211+ git_command .run (tmp_path , "commit" , "-m" , "c" )
208212 assert marker .exists ()
209213 finally :
210214 git_policy .set_repo_hook_policy (False ) # reset process-wide policy for other tests
@@ -271,7 +275,9 @@ def test_commit_diff_survives_poisoned_diff_external(tmp_path: pathlib.Path) ->
271275 check = True ,
272276 )
273277 (tmp_path / "README.md" ).write_text ("changed\n " , encoding = "utf-8" )
274- sha = git_ops .commit_all (tmp_path , "change readme" )
278+ subprocess .run (["git" , "-C" , str (tmp_path ), "add" , "-A" ], check = True )
279+ subprocess .run (["git" , "-C" , str (tmp_path ), "commit" , "-q" , "-m" , "change readme" ], check = True )
280+ sha = _rev (tmp_path , "HEAD" )
275281 out = git_read .commit_diff (tmp_path , sha )
276282 assert not marker .exists (), "repo diff.external command executed on the host"
277283 assert "README.md" in out , "git show honored the external diff and lost the patch"
@@ -303,7 +309,9 @@ def test_commit_diff_survives_poisoned_textconv(tmp_path: pathlib.Path) -> None:
303309 marker = tmp_path / "PWNED_TEXTCONV_SHOW"
304310 _poison_textconv (tmp_path , marker )
305311 (tmp_path / "README.md" ).write_text ("changed\n " , encoding = "utf-8" )
306- sha = git_ops .commit_all (tmp_path , "change readme" )
312+ subprocess .run (["git" , "-C" , str (tmp_path ), "add" , "-A" ], check = True )
313+ subprocess .run (["git" , "-C" , str (tmp_path ), "commit" , "-q" , "-m" , "change readme" ], check = True )
314+ sha = _rev (tmp_path , "HEAD" )
307315 out = git_read .commit_diff (tmp_path , sha )
308316 assert not marker .exists (), "git show ran the repo textconv driver on the host"
309317 assert "README.md" in out , "git show lost the patch under --no-textconv"
@@ -322,7 +330,8 @@ def test_git_ops_neutralizes_repo_gpg_signing(tmp_path: pathlib.Path) -> None:
322330 check = True ,
323331 )
324332 (tmp_path / "n.txt" ).write_text ("x\n " , encoding = "utf-8" )
325- git_ops .commit_all (tmp_path , "c" ) # must not raise or fire the signing program
333+ git_command .run (tmp_path , "add" , "-A" )
334+ git_command .run (tmp_path , "commit" , "-m" , "c" ) # must not raise or fire the signing program
326335 assert not marker .exists (), "repo gpg.program executed on the host during commit"
327336
328337
@@ -364,15 +373,6 @@ def test_status_dirty_repo(tmp_path: pathlib.Path) -> None:
364373 assert st .untracked_count == 1
365374
366375
367- def test_commit_all_returns_sha_and_log (tmp_path : pathlib .Path ) -> None :
368- _init_repo (tmp_path )
369- (tmp_path / "f.txt" ).write_text ("y" , encoding = "utf-8" )
370- sha = git_ops .commit_all (tmp_path , "add f" , trailers = {"agent6-step" : "x" })
371- assert len (sha ) == 40
372- log = git_read .recent_log (tmp_path , n = 5 )
373- assert "add f" in log
374-
375-
376376def test_create_branch (tmp_path : pathlib .Path ) -> None :
377377 _init_repo (tmp_path )
378378 git_ops .create_branch (tmp_path , "agent6/test" )
@@ -385,7 +385,8 @@ def test_create_branch_at_is_additive_no_checkout(tmp_path: pathlib.Path) -> Non
385385 base = git_read .status (tmp_path ).head_sha
386386 # Advance HEAD so base != current; the fork branch must land on base.
387387 (tmp_path / "b.txt" ).write_text ("b\n " , encoding = "utf-8" )
388- git_ops .commit_all (tmp_path , "second" )
388+ subprocess .run (["git" , "-C" , str (tmp_path ), "add" , "-A" ], check = True )
389+ subprocess .run (["git" , "-C" , str (tmp_path ), "commit" , "-q" , "-m" , "second" ], check = True )
389390 git_ops .create_branch_at (tmp_path , "agent6/fork" , base )
390391 assert git_read .status (tmp_path ).branch == "main" , "must not check out the new branch"
391392 forked = subprocess .run (
@@ -407,7 +408,9 @@ def test_create_branch_at_idempotent_and_refuses_move(tmp_path: pathlib.Path) ->
407408 git_ops .create_branch_at (tmp_path , "agent6/fork" , base )
408409 git_ops .create_branch_at (tmp_path , "agent6/fork" , base ) # idempotent: no raise
409410 (tmp_path / "c.txt" ).write_text ("c\n " , encoding = "utf-8" )
410- other = git_ops .commit_all (tmp_path , "third" )
411+ subprocess .run (["git" , "-C" , str (tmp_path ), "add" , "-A" ], check = True )
412+ subprocess .run (["git" , "-C" , str (tmp_path ), "commit" , "-q" , "-m" , "third" ], check = True )
413+ other = _rev (tmp_path , "HEAD" )
411414 with pytest .raises (errors .GitError ):
412415 git_ops .create_branch_at (tmp_path , "agent6/fork" , other )
413416
@@ -530,28 +533,6 @@ def test_verify_git_identity_missing_raises(
530533 git_read .verify_git_identity (repo , git_read .CommitIdentity ())
531534
532535
533- def test_commit_all_with_identity_overrides_author (tmp_path : pathlib .Path ) -> None :
534- _init_repo (tmp_path )
535- (tmp_path / "f.txt" ).write_text ("y" , encoding = "utf-8" )
536- sha = git_ops .commit_all (
537- tmp_path ,
538- "add f" ,
539- identity = git_read .CommitIdentity (
540- name = "agent6" ,
541- email = "agent6@example.com" ,
542- trailer = "Co-authored-by: Alice <alice@example.com>" ,
543- ),
544- )
545- show = subprocess .run (
546- ["git" , "-C" , str (tmp_path ), "show" , "--no-patch" , "--format=%an|%ae|%B" , sha ],
547- check = True ,
548- capture_output = True ,
549- text = True ,
550- ).stdout
551- assert "agent6|agent6@example.com|" in show
552- assert "Co-authored-by: Alice <alice@example.com>" in show
553-
554-
555536def test_commit_error_surfaces_stdout_when_stderr_empty (tmp_path : pathlib .Path ) -> None :
556537 """A failed git's error text includes stdout when stderr is empty.
557538
@@ -560,7 +541,7 @@ def test_commit_error_surfaces_stdout_when_stderr_empty(tmp_path: pathlib.Path)
560541 _init_repo (tmp_path )
561542 # `git commit` exits 1 with "nothing to commit, working tree clean" on stdout.
562543 with pytest .raises (errors .GitError ) as excinfo :
563- git_ops . commit_all (tmp_path , "no-op commit on clean repo" )
544+ git_command . run (tmp_path , "commit" , "-m" , "no-op commit on clean repo" )
564545 msg = str (excinfo .value )
565546 # The detail (from stdout) must be present so callers can pattern-match.
566547 assert "nothing to commit" in msg .lower ()
@@ -588,7 +569,10 @@ def test_restore_stash_conflict_keeps_stash(tmp_path: pathlib.Path) -> None:
588569 git_ops .stash_tracked_changes (tmp_path , "agent6 auto-stash" )
589570 # A conflicting commit on the same line means the stash cannot apply cleanly.
590571 (tmp_path / "README.md" ).write_text ("committed change\n " , encoding = "utf-8" )
591- git_ops .commit_all (tmp_path , "conflicting commit" )
572+ subprocess .run (["git" , "-C" , str (tmp_path ), "add" , "-A" ], check = True )
573+ subprocess .run (
574+ ["git" , "-C" , str (tmp_path ), "commit" , "-q" , "-m" , "conflicting commit" ], check = True
575+ )
592576 entry = git_read .find_stash (tmp_path , "agent6 auto-stash" )
593577 assert entry is not None
594578 assert git_ops .restore_stash (tmp_path , entry ) is False
@@ -1335,21 +1319,6 @@ def test_condense_subject_drops_only_a_markdown_heading_mark() -> None:
13351319 )
13361320
13371321
1338- def test_commit_all_appends_the_identity_trailer_once (tmp_path : pathlib .Path ) -> None :
1339- _init_repo (tmp_path )
1340- (tmp_path / "f.txt" ).write_text ("x" , encoding = "utf-8" )
1341- line = "Assisted-by: agent6:m1 (worker)"
1342- git_ops .commit_all (tmp_path , "add f" , identity = git_read .CommitIdentity (trailer = line ))
1343- head_msg = subprocess .run (
1344- ["git" , "-C" , str (tmp_path ), "log" , "-1" , "--format=%B" ],
1345- capture_output = True ,
1346- text = True ,
1347- check = True ,
1348- ).stdout
1349- assert head_msg .count (line ) == 1
1350- assert head_msg .splitlines ()[0 ] == "add f"
1351-
1352-
13531322def test_render_commit_trailer_joins_the_code_writers () -> None :
13541323 assert commit_message .render_commit_trailer ("" , models = ("m" ,)) is None
13551324 got = commit_message .render_commit_trailer ("Assisted-by: agent6:{model}" , models = ("m1" ,))
0 commit comments