easy-worktree 0.1.3__tar.gz → 0.1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {easy_worktree-0.1.3 → easy_worktree-0.1.4}/PKG-INFO +1 -1
- {easy_worktree-0.1.3 → easy_worktree-0.1.4}/easy_worktree/__init__.py +3 -2
- {easy_worktree-0.1.3 → easy_worktree-0.1.4}/pyproject.toml +1 -1
- {easy_worktree-0.1.3 → easy_worktree-0.1.4}/tests/test_integration.py +30 -0
- {easy_worktree-0.1.3 → easy_worktree-0.1.4}/.gitignore +0 -0
- {easy_worktree-0.1.3 → easy_worktree-0.1.4}/.python-version +0 -0
- {easy_worktree-0.1.3 → easy_worktree-0.1.4}/DEPLOY.md +0 -0
- {easy_worktree-0.1.3 → easy_worktree-0.1.4}/GEMINI.md +0 -0
- {easy_worktree-0.1.3 → easy_worktree-0.1.4}/LICENSE +0 -0
- {easy_worktree-0.1.3 → easy_worktree-0.1.4}/README.md +0 -0
- {easy_worktree-0.1.3 → easy_worktree-0.1.4}/README_ja.md +0 -0
- {easy_worktree-0.1.3 → easy_worktree-0.1.4}/hero.png +0 -0
- {easy_worktree-0.1.3 → easy_worktree-0.1.4}/uv.lock +0 -0
|
@@ -340,7 +340,7 @@ def create_hook_template(base_dir: Path):
|
|
|
340
340
|
# .gitignore
|
|
341
341
|
gitignore_file = wt_dir / ".gitignore"
|
|
342
342
|
|
|
343
|
-
ignores = ["post-add.local", "config.local.toml"]
|
|
343
|
+
ignores = ["post-add.local", "config.local.toml", "last_selection"]
|
|
344
344
|
|
|
345
345
|
if not gitignore_file.exists():
|
|
346
346
|
gitignore_content = "\n".join(ignores) + "\n"
|
|
@@ -1415,7 +1415,8 @@ def cmd_select(args: list[str]):
|
|
|
1415
1415
|
sys.exit(1)
|
|
1416
1416
|
|
|
1417
1417
|
wt_dir = base_dir / ".wt"
|
|
1418
|
-
|
|
1418
|
+
# Ensure .wt directory and its management files (.gitignore etc) exist
|
|
1419
|
+
create_hook_template(base_dir)
|
|
1419
1420
|
last_sel_file = wt_dir / "last_selection"
|
|
1420
1421
|
|
|
1421
1422
|
# Get current selection name based on CWD or environment
|
|
@@ -732,5 +732,35 @@ touch hook_ran.txt
|
|
|
732
732
|
self.assertFalse((wt_dir / "base.txt").exists(), "Should NOT have copied base.txt (overridden)")
|
|
733
733
|
|
|
734
734
|
|
|
735
|
+
def test_19_wt_gitignore_last_selection(self):
|
|
736
|
+
"""Test if .wt/.gitignore contains last_selection after wt select"""
|
|
737
|
+
project_dir = self.test_dir / "wt-gitignore-test"
|
|
738
|
+
if project_dir.exists():
|
|
739
|
+
shutil.rmtree(project_dir)
|
|
740
|
+
project_dir.mkdir()
|
|
741
|
+
subprocess.run(["git", "init"], cwd=project_dir)
|
|
742
|
+
(project_dir / "README.md").write_text("Hello")
|
|
743
|
+
subprocess.run(["git", "add", "."], cwd=project_dir)
|
|
744
|
+
subprocess.run(["git", "commit", "-m", "Initial commit"], cwd=project_dir)
|
|
745
|
+
|
|
746
|
+
# wt init
|
|
747
|
+
self.run_wt(["init"], cwd=project_dir)
|
|
748
|
+
|
|
749
|
+
# Verify .wt/.gitignore exists and contains last_selection
|
|
750
|
+
wt_gitignore = project_dir / ".wt" / ".gitignore"
|
|
751
|
+
self.assertTrue(wt_gitignore.exists())
|
|
752
|
+
self.assertIn("last_selection", wt_gitignore.read_text())
|
|
753
|
+
|
|
754
|
+
# Test wt select also triggers it (though init already does)
|
|
755
|
+
# Remove .wt to test re-creation/initialization by select
|
|
756
|
+
shutil.rmtree(project_dir / ".wt")
|
|
757
|
+
self.assertFalse((project_dir / ".wt").exists())
|
|
758
|
+
|
|
759
|
+
# Run wt select main
|
|
760
|
+
self.run_wt(["select", "main"], cwd=project_dir)
|
|
761
|
+
|
|
762
|
+
self.assertTrue(wt_gitignore.exists())
|
|
763
|
+
self.assertIn("last_selection", wt_gitignore.read_text())
|
|
764
|
+
|
|
735
765
|
if __name__ == "__main__":
|
|
736
766
|
unittest.main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|