diff options
| author | godosa <godosa@godosa.eu> | 2026-10-07 07:57:29 +0200 |
|---|---|---|
| committer | godosa <godosa@godosa.eu> | 2026-10-07 07:57:29 +0200 |
| commit | 5efcac492566e965820be757556bfdc1f17a2475 (patch) | |
| tree | b1b62fd714b988e0b5224bc85a9528ee1ad3745b | |
| parent | 930d8e023b5a4ac2e179aa80a74951cd5452668e (diff) | |
| download | workflow-5efcac492566e965820be757556bfdc1f17a2475.tar.gz workflow-5efcac492566e965820be757556bfdc1f17a2475.zip | |
wf finish: status -uall so new untracked file paths are accepted
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JEAjUkQRrCYX5MZhWxdtj2
| -rw-r--r-- | tests/test_finish.py | 7 | ||||
| -rwxr-xr-x | wf.py | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/tests/test_finish.py b/tests/test_finish.py index 38fceb1..e7ac11b 100644 --- a/tests/test_finish.py +++ b/tests/test_finish.py @@ -88,6 +88,13 @@ class FinishTest(Cli): self.assertEqual(out.count("TASKS.md"), 1, out) self.assertEqual(self.out("log", "--format=%s", "master"), "bk\ninit\n") + def test_new_untracked_dir_file_path_accepted(self): + (self.wt / "docs" / "notes").mkdir(parents=True) + (self.wt / "docs" / "notes" / "SCOPE.md").write_text("s\n") + code, out, err = self.finish("t-three", "-m", "ok", "--commit", "impl", "docs/notes/SCOPE.md", "--no-push") + self.assertEqual((code, err), (0, ""), out) + self.assertIn("docs/notes/SCOPE.md", self.out("show", "--stat", "--format=", "master~1")) + def test_dirty_outside_paths_refused_before_done(self): self.write_code() (self.wt / "DESIGN.md").write_text("stray\n") @@ -1220,7 +1220,7 @@ def cmd_merge(args) -> int: master = config.git_branch(main / ".git") or "master" cfg = config.load_at(start) files = [str(f.relative_to(main)) for f in (cfg.tasks, cfg.archive)] - if git_run(top, "status", "--porcelain").stdout.strip(): + if git_run(top, "status", "--porcelain", "-uall").stdout.strip(): raise Failure("worktree has uncommitted changes: commit them first") if not branch and not unmerged_count(top, master): # after a merge: notes / follow-ups written since → bookkeeping commit only @@ -1271,7 +1271,7 @@ def _push_home(main: Path) -> bool: def _dirty_outside(top: Path, keep: list[Path]) -> list[str]: """Uncommitted paths of the repo at `top` not under any of `keep` (absolute paths).""" stray = [] - for line in git_run(top, "status", "--porcelain").stdout.splitlines(): + for line in git_run(top, "status", "--porcelain", "-uall").stdout.splitlines(): rel = line[3:].split(" -> ")[-1].strip('"').rstrip("/") path = (top / rel).resolve() if not any(path == k or k in path.parents for k in keep): |
