kin: auto-commit after pipeline
This commit is contained in:
parent
95ba853b49
commit
24996b3974
4 changed files with 77 additions and 11 deletions
|
|
@ -507,7 +507,11 @@ class TestMergeWorktree:
|
|||
merge_ok = MagicMock(returncode=0, stdout="", stderr="")
|
||||
diff_ok = MagicMock(returncode=0, stdout="src/api.py\nsrc/models.py\n", stderr="")
|
||||
|
||||
with patch("core.worktree.subprocess.run", side_effect=[merge_ok, diff_ok]):
|
||||
add_ok = MagicMock(returncode=0, stdout="", stderr="")
|
||||
commit_ok = MagicMock(returncode=0, stdout="", stderr="")
|
||||
# Fix B adds git add -A + git commit before merge
|
||||
with patch("core.worktree.subprocess.run",
|
||||
side_effect=[add_ok, commit_ok, merge_ok, diff_ok]):
|
||||
result = merge_worktree(worktree, str(tmp_path))
|
||||
|
||||
assert result["success"] is True
|
||||
|
|
@ -523,8 +527,11 @@ class TestMergeWorktree:
|
|||
conflict_files = MagicMock(returncode=0, stdout="src/models.py\n", stderr="")
|
||||
abort = MagicMock(returncode=0)
|
||||
|
||||
add_ok = MagicMock(returncode=0, stdout="", stderr="")
|
||||
commit_ok = MagicMock(returncode=0, stdout="", stderr="")
|
||||
# Fix B adds git add -A + git commit before merge
|
||||
with patch("core.worktree.subprocess.run",
|
||||
side_effect=[merge_fail, conflict_files, abort]):
|
||||
side_effect=[add_ok, commit_ok, merge_fail, conflict_files, abort]):
|
||||
result = merge_worktree(worktree, str(tmp_path))
|
||||
|
||||
assert result["success"] is False
|
||||
|
|
|
|||
|
|
@ -144,8 +144,10 @@ class TestMergeWorktree:
|
|||
worktree_path = tmp_path / ".kin_worktrees" / "WT1-001-debugger"
|
||||
worktree_path.mkdir(parents=True)
|
||||
|
||||
# First call: merge succeeds; second: diff
|
||||
# Fix B adds git add -A + git commit before merge
|
||||
mock_run.side_effect = [
|
||||
_ok_run(), # git add -A
|
||||
_ok_run(), # git commit -m
|
||||
_ok_run(), # git merge --no-ff
|
||||
_ok_run(), # git diff HEAD~1 HEAD --name-only
|
||||
]
|
||||
|
|
@ -172,7 +174,8 @@ class TestMergeWorktree:
|
|||
|
||||
merge_fail = _fail_run("CONFLICT (content)")
|
||||
|
||||
mock_run.side_effect = [merge_fail, conflict_diff, abort_result]
|
||||
# Fix B adds git add -A + git commit before merge
|
||||
mock_run.side_effect = [_ok_run(), _ok_run(), merge_fail, conflict_diff, abort_result]
|
||||
|
||||
result = merge_worktree(str(worktree_path), str(tmp_path))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue