Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

Remove shell output integration test snapshots

Maximilian Roos4abcff6c151f
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__fish_multiline_command_execution.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__fish_multiline_command_execution.snap
deleted file mode 100644
index 469ec5864..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__fish_multiline_command_execution.snap
+++ /dev/null
@@ -1,8 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: normalized.as_ref()
----
-Created new worktree for fish-multiline at [TMPDIR]/test-repo.fish-multiline
-line 1
-line 2
-line 3
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__fish_remove_no_directive_leak.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__fish_remove_no_directive_leak.snap
deleted file mode 100644
index ba57bc54a..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__fish_remove_no_directive_leak.snap
+++ /dev/null
@@ -1,5 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: normalized.as_ref()
----
-Removed worktree for fish-to-remove
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__fish_switch_create_no_directive_leak.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__fish_switch_create_no_directive_leak.snap
deleted file mode 100644
index 3653a65c8..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__fish_switch_create_no_directive_leak.snap
+++ /dev/null
@@ -1,7 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: normalized.as_ref()
----
-Created new worktree for fish-feature at [TMPDIR]/test-repo.fish-feature
-
-To enable automatic cd, run: wt configure-shell
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__fish_wrapper_handles_empty_chunks.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__fish_wrapper_handles_empty_chunks.snap
deleted file mode 100644
index 07cb096e3..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__fish_wrapper_handles_empty_chunks.snap
+++ /dev/null
@@ -1,7 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: normalized.as_ref()
----
-Created new worktree for fish-minimal at [TMPDIR]/test-repo.fish-minimal
-
-To enable automatic cd, run: wt configure-shell
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__fish_wrapper_preserves_progress_messages.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__fish_wrapper_preserves_progress_messages.snap
deleted file mode 100644
index 54ffee1a0..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__fish_wrapper_preserves_progress_messages.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: normalized.as_ref()
----
-πŸ”„ Starting (background):
- echo 'fish background task'
-
-Created new worktree for fish-bg at [TMPDIR]/test-repo.fish-bg
-
-To enable automatic cd, run: wt configure-shell
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__merge_through_wrapper_no_directive_leak.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__merge_through_wrapper_no_directive_leak.snap
deleted file mode 100644
index e87fc5646..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__merge_through_wrapper_no_directive_leak.snap
+++ /dev/null
@@ -1,6 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: normalized.as_ref()
----
-πŸ”„ Validating merge...
-Already on main, nothing to merge
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__remove_through_wrapper_no_directive_leak.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__remove_through_wrapper_no_directive_leak.snap
deleted file mode 100644
index 822ddf544..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__remove_through_wrapper_no_directive_leak.snap
+++ /dev/null
@@ -1,5 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: output
----
-Removed worktree for to-remove
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__switch_create_through_wrapper_no_directive_leak.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__switch_create_through_wrapper_no_directive_leak.snap
deleted file mode 100644
index b422750b2..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__switch_create_through_wrapper_no_directive_leak.snap
+++ /dev/null
@@ -1,7 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: normalized.as_ref()
----
-Created new worktree for feature at [TMPDIR]/test-repo.feature
-
-To enable automatic cd, run: wt configure-shell
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__switch_with_execute_through_wrapper.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__switch_with_execute_through_wrapper.snap
deleted file mode 100644
index 884eb3b3b..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__switch_with_execute_through_wrapper.snap
+++ /dev/null
@@ -1,6 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: normalized.as_ref()
----
-Created new worktree for test-exec at [TMPDIR]/test-repo.test-exec
-executed
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__switch_with_post_start_command_no_directive_leak.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__switch_with_post_start_command_no_directive_leak.snap
deleted file mode 100644
index 41378e994..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__switch_with_post_start_command_no_directive_leak.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: normalized.as_ref()
----
-πŸ”„ Starting (background):
- echo 'test command executed'
-
-Created new worktree for feature-with-hooks at [TMPDIR]/test-repo.feature-with-hooks
-
-To enable automatic cd, run: wt configure-shell
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_remove_no_directive_leak.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_remove_no_directive_leak.snap
deleted file mode 100644
index 3a77e65bc..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_remove_no_directive_leak.snap
+++ /dev/null
@@ -1,6 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: normalized.as_ref()
----
-πŸ”„ Removing worktree for fish-to-remove...
-βœ… Removed worktree for fish-to-remove
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_shell_integration_hint_suppressed.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_shell_integration_hint_suppressed.snap
deleted file mode 100644
index 3cb3d296a..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_shell_integration_hint_suppressed.snap
+++ /dev/null
@@ -1,5 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: normalized.as_ref()
----
-βœ… Created new worktree for fish-test at [TMPDIR]/test-repo.fish-test
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_switch_create_no_directive_leak.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_switch_create_no_directive_leak.snap
deleted file mode 100644
index 0ea4a5429..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__fish_switch_create_no_directive_leak.snap
+++ /dev/null
@@ -1,5 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: normalized.as_ref()
----
-βœ… Created new worktree for fish-feature at [TMPDIR]/test-repo.fish-feature
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_already_on_target_bash.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_already_on_target_bash.snap
deleted file mode 100644
index a40888224..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_already_on_target_bash.snap
+++ /dev/null
@@ -1,6 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: output.normalized().as_ref()
----
-πŸ”„ Validating merge...
-βœ… Already on main, nothing to merge
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_already_on_target_fish.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_already_on_target_fish.snap
deleted file mode 100644
index a40888224..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_already_on_target_fish.snap
+++ /dev/null
@@ -1,6 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: output.normalized().as_ref()
----
-πŸ”„ Validating merge...
-βœ… Already on main, nothing to merge
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_through_wrapper_no_directive_leak.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_through_wrapper_no_directive_leak.snap
deleted file mode 100644
index 739d0989c..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_through_wrapper_no_directive_leak.snap
+++ /dev/null
@@ -1,6 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: normalized.as_ref()
----
-πŸ”„ Validating merge...
-βœ… Already on main, nothing to merge
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_no_hooks_bash.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_no_hooks_bash.snap
deleted file mode 100644
index d8b334233..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_no_hooks_bash.snap
+++ /dev/null
@@ -1,17 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: output.normalized().as_ref()
----
-πŸ”„ Validating merge...
-πŸ”„ Rebasing onto main...
-πŸ”„ Pushing 1 commit to main @ 986886a
-
-* 986886a (HEAD -> feature-nohooks) Add feature
-
- feature.txt | 1 +
- 1 file changed, 1 insertion(+)
-
-βœ… Pushed to main (1 commit, 1 file, +1) 
-πŸ”„ Cleaning up worktree...
-
-βœ… Returned to primary at [TMPDIR]/test-repo
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_no_hooks_fish.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_no_hooks_fish.snap
deleted file mode 100644
index 2409f6dc9..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_no_hooks_fish.snap
+++ /dev/null
@@ -1,16 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: output.normalized().as_ref()
----
-πŸ”„ Validating merge...
-πŸ”„ Rebasing onto main...
-πŸ”„ Pushing 1 commit to main @ 986886a
-
-* 986886a (HEAD -> feature-nohooks) Add feature
-
- feature.txt | 1 +
- 1 file changed, 1 insertion(+)
-
-βœ… Pushed to main (1 commit, 1 file, +1) 
-πŸ”„ Cleaning up worktree...
-βœ… Returned to primary at [TMPDIR]/test-repo
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_post_merge_hooks_bash.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_post_merge_hooks_bash.snap
deleted file mode 100644
index 15d90f29e..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_post_merge_hooks_bash.snap
+++ /dev/null
@@ -1,32 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: output.normalized().as_ref()
----
-πŸ”„ Validating merge...
-πŸ”„ Rebasing onto main...
-πŸ”„ Pushing 1 commit to main @ c6eae6a
-
-* c6eae6a (HEAD -> feature-post) Add feature
-
- feature.txt | 1 +
- 1 file changed, 1 insertion(+)
-
-βœ… Pushed to main (1 commit, 1 file, +1) 
-πŸ”„ Running post-merge command cleanup:
-  echo 'βœ“ Cleaning up temporary files'
-
-βœ“ Cleaning up temporary files
-
-πŸ”„ Running post-merge command deploy:
-  echo 'βœ“ Triggering deployment pipeline'
-
-βœ“ Triggering deployment pipeline
-
-πŸ”„ Running post-merge command notify:
-  echo 'βœ“ Merge successful - notifying team'
-
-βœ“ Merge successful - notifying team
-
-πŸ”„ Cleaning up worktree...
-
-βœ… Returned to primary at [TMPDIR]/test-repo
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_post_merge_hooks_fish.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_post_merge_hooks_fish.snap
deleted file mode 100644
index f72e369d3..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__merge_with_post_merge_hooks_fish.snap
+++ /dev/null
@@ -1,28 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: output.normalized().as_ref()
----
-πŸ”„ Validating merge...
-πŸ”„ Rebasing onto main...
-πŸ”„ Pushing 1 commit to main @ c6eae6a
-
-* c6eae6a (HEAD -> feature-post) Add feature
-
- feature.txt | 1 +
- 1 file changed, 1 insertion(+)
-
-βœ… Pushed to main (1 commit, 1 file, +1) 
-πŸ”„ Running post-merge command cleanup:
-  echo 'βœ“ Cleaning up temporary files'
-
-πŸ”„ Running post-merge command deploy:
-  echo 'βœ“ Triggering deployment pipeline'
-
-πŸ”„ Running post-merge command notify:
-  echo 'βœ“ Merge successful - notifying team'
-
-πŸ”„ Cleaning up worktree...
-βœ… Returned to primary at [TMPDIR]/test-repo
-βœ“ Cleaning up temporary files
-βœ“ Triggering deployment pipeline
-βœ“ Merge successful - notifying team
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__remove_through_wrapper_no_directive_leak.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__remove_through_wrapper_no_directive_leak.snap
deleted file mode 100644
index 3d7db98f7..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__remove_through_wrapper_no_directive_leak.snap
+++ /dev/null
@@ -1,6 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: normalized.as_ref()
----
-πŸ”„ Removing worktree for to-remove...
-βœ… Removed worktree for to-remove
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_create_through_wrapper_no_directive_leak.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_create_through_wrapper_no_directive_leak.snap
deleted file mode 100644
index 2aefedc88..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_create_through_wrapper_no_directive_leak.snap
+++ /dev/null
@@ -1,5 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: normalized.as_ref()
----
-βœ… Created new worktree for feature at [TMPDIR]/test-repo.feature
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_log_paths_bash.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_log_paths_bash.snap
deleted file mode 100644
index 6c313484f..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_log_paths_bash.snap
+++ /dev/null
@@ -1,11 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: output.normalized().as_ref()
----
-πŸ”„ Starting (background):
-  sleep 0.1 && echo 'Server output'
-
-πŸ”„ Starting (background):
-  sleep 0.1 && echo 'Watcher output'
-
-βœ… Created new worktree for feature-logs at [TMPDIR]/test-repo.feature-logs
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_log_paths_fish.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_log_paths_fish.snap
deleted file mode 100644
index 6c313484f..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_log_paths_fish.snap
+++ /dev/null
@@ -1,11 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: output.normalized().as_ref()
----
-πŸ”„ Starting (background):
-  sleep 0.1 && echo 'Server output'
-
-πŸ”„ Starting (background):
-  sleep 0.1 && echo 'Watcher output'
-
-βœ… Created new worktree for feature-logs at [TMPDIR]/test-repo.feature-logs
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_uncommitted_changes_bash.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_uncommitted_changes_bash.snap
deleted file mode 100644
index 6d6577aca..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_uncommitted_changes_bash.snap
+++ /dev/null
@@ -1,5 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: output.normalized().as_ref()
----
-βœ… Created new worktree for feature at [TMPDIR]/test-repo.feature
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_uncommitted_changes_fish.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_uncommitted_changes_fish.snap
deleted file mode 100644
index 6d6577aca..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__tests__switch_with_uncommitted_changes_fish.snap
+++ /dev/null
@@ -1,5 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: output.normalized().as_ref()
----
-βœ… Created new worktree for feature at [TMPDIR]/test-repo.feature
diff --git a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__wrapper_preserves_progress_messages.snap b/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__wrapper_preserves_progress_messages.snap
deleted file mode 100644
index 18bdf6bd7..000000000
--- a/tests/integration_tests/snapshots/integration__integration_tests__shell_wrapper__wrapper_preserves_progress_messages.snap
+++ /dev/null
@@ -1,10 +0,0 @@
----
-source: tests/integration_tests/shell_wrapper.rs
-expression: normalized.as_ref()
----
-πŸ”„ Starting (background):
- echo 'background task'
-
-Created new worktree for feature-bg at [TMPDIR]/test-repo.feature-bg
-
-To enable automatic cd, run: wt configure-shell
diff --git a/tests/snapshots/integration__integration_tests__init__init_elvish.snap b/tests/snapshots/integration__integration_tests__init__init_elvish.snap
deleted file mode 100644
index 32becbe64..000000000
--- a/tests/snapshots/integration__integration_tests__init__init_elvish.snap
+++ /dev/null
@@ -1,102 +0,0 @@
----
-source: tests/integration_tests/init.rs
-info:
- program: wt
- args:
- - init
- - elvish
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "150"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpQU88tl/test-config.toml
----
-success: false
-exit_code: 1
------ stdout -----
-# worktrunk shell integration for elvish
-
-# Only initialize if wt is available
-if (has-external wt) {
- # Use WORKTRUNK_BIN if set, otherwise default to 'wt'
- # This allows testing development builds: set E:WORKTRUNK_BIN = ./target/debug/wt
- var _WORKTRUNK_CMD = wt
- if (has-env WORKTRUNK_BIN) {
- set _WORKTRUNK_CMD = $E:WORKTRUNK_BIN
- }
-
- # Helper function to parse wt output and handle directives
- # Directives are NUL-terminated to support multi-line commands
- fn _wt_exec {|@args|
- var exit-code = 0
- var output = ""
- var exec-cmd = ""
-
- # Capture stdout for directives, let stderr pass through to terminal
- # This preserves TTY for color detection
- # TODO: Capture actual exit code from wt command, not just success/failure
- try {
- set output = (e:$_WORKTRUNK_CMD $@args | slurp)
- } catch e {
- set exit-code = 1
- set output = $e[reason][content]
- }
-
- # Split output on NUL bytes, process each chunk
- var chunks = [(str:split "\x00" $output)]
- for chunk $chunks {
- if (str:has-prefix $chunk "__WORKTRUNK_CD__") {
- # CD directive - extract path and change directory
- var path = (str:trim-prefix $chunk "__WORKTRUNK_CD__")
- cd $path
- } elif (str:has-prefix $chunk "__WORKTRUNK_EXEC__") {
- # EXEC directive - extract command (may contain newlines)
- set exec-cmd = (str:trim-prefix $chunk "__WORKTRUNK_EXEC__")
- } elif (!=s $chunk "") {
- # Regular output - print it (preserving newlines)
- print $chunk
- }
- }
-
- # Execute command if one was specified
- if (!=s $exec-cmd "") {
- eval $exec-cmd
- }
-
- # Return exit code (will throw exception if non-zero)
- if (!=s $exit-code 0) {
- fail "command failed with exit code "$exit-code
- }
- }
-
- # Override wt command to add --internal flag for switch, remove, and merge
- fn wt {|@args|
- if (== (count $args) 0) {
- e:$_WORKTRUNK_CMD
- return
- }
-
- var subcommand = $args[0]
-
- if (or (eq $subcommand "switch") (eq $subcommand "remove") (eq $subcommand "merge")) {
- # Commands that need --internal for directory change support
- var rest-args = $args[1..]
- _wt_exec --internal $subcommand $@rest-args
- } else {
- # All other commands pass through directly
- e:$_WORKTRUNK_CMD $@args
- }
- }
-}
-
-# Static completions (commands and flags)
-❌ Completion not yet supported for elvish
-
------ stderr -----
diff --git a/tests/snapshots/integration__integration_tests__init__init_nushell.snap b/tests/snapshots/integration__integration_tests__init__init_nushell.snap
deleted file mode 100644
index e5e6103a7..000000000
--- a/tests/snapshots/integration__integration_tests__init__init_nushell.snap
+++ /dev/null
@@ -1,88 +0,0 @@
----
-source: tests/integration_tests/init.rs
-info:
- program: wt
- args:
- - init
- - nushell
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "150"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpv1CFmG/test-config.toml
----
-success: false
-exit_code: 1
------ stdout -----
-# worktrunk shell integration for nushell
-
-# Only initialize if wt is available
-if (which wt | is-not-empty) {
- # Use WORKTRUNK_BIN if set, otherwise default to 'wt'
- # This allows testing development builds: $env.WORKTRUNK_BIN = ./target/debug/wt
- let _WORKTRUNK_CMD = (if ($env.WORKTRUNK_BIN? | is-not-empty) { $env.WORKTRUNK_BIN } else { "wt" })
-
- # Helper function to parse wt output and handle directives
- # Directives are NUL-terminated to support multi-line commands
- export def --env _wt_exec [...args] {
- let result = (do { ^$_WORKTRUNK_CMD ...$args } | complete)
- mut exec_cmd = ""
-
- # Split output on NUL bytes, process each chunk
- for chunk in ($result.stdout | split row "\u{0000}") {
- if ($chunk | str starts-with "__WORKTRUNK_CD__") {
- # CD directive - extract path and change directory
- # TODO: Use str replace instead of hard-coded offset (fragile if prefix changes)
- let path = ($chunk | str substring 16..)
- cd $path
- } else if ($chunk | str starts-with "__WORKTRUNK_EXEC__") {
- # EXEC directive - extract command (may contain newlines)
- # TODO: Use str replace instead of hard-coded offset (fragile if prefix changes)
- $exec_cmd = ($chunk | str substring 18..)
- } else if ($chunk | str length) > 0 {
- # Regular output - print it with newline
- print $chunk
- }
- }
-
- # Execute command if one was specified
- if ($exec_cmd != "") {
- nu -c $exec_cmd
- }
-
- # Return the exit code
- return $result.exit_code
- }
-
- # Override wt command to add --internal flag for switch, remove, and merge
- # Use --wrapped to pass through all flags without parsing them
- export def --env --wrapped wt [...rest] {
- let subcommand = ($rest | get 0? | default "")
-
- match $subcommand {
- "switch" | "remove" | "merge" => {
- # Commands that need --internal for directory change support
- let rest_args = ($rest | skip 1)
- let internal_args = (["--internal", $subcommand] | append $rest_args)
- let exit_code = (_wt_exec ...$internal_args)
- return $exit_code
- }
- _ => {
- # All other commands pass through directly
- ^$_WORKTRUNK_CMD ...$rest
- }
- }
- }
-}
-
-# Static completions (commands and flags)
-❌ Completion not yet supported for nushell
-
------ stderr -----
diff --git a/tests/snapshots/integration__integration_tests__init__init_oil.snap b/tests/snapshots/integration__integration_tests__init__init_oil.snap
deleted file mode 100644
index 9bc6370f8..000000000
--- a/tests/snapshots/integration__integration_tests__init__init_oil.snap
+++ /dev/null
@@ -1,400 +0,0 @@
----
-source: tests/integration_tests/init.rs
-info:
- program: wt
- args:
- - init
- - oil
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "150"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpbvT6J1/test-config.toml
----
-success: true
-exit_code: 0
------ stdout -----
-# worktrunk shell integration for oil
-
-# Only initialize if wt is available
-if command -v wt >/dev/null 2>&1; then
- # Use WORKTRUNK_BIN if set, otherwise default to 'wt'
- # This allows testing development builds: export WORKTRUNK_BIN=./target/debug/wt
- _WORKTRUNK_CMD="${WORKTRUNK_BIN:-wt}"
-
- # Helper function to parse wt output and handle directives
- # Directives are NUL-terminated to support multi-line commands
- _wt_exec() {
- local exec_cmd="" chunk exit_code
- local exit_code_file
- exit_code_file=$(mktemp) || { echo "Failed to create temp file" >&2; return 1; }
-
- # Parse stdout for directives (NUL-delimited)
- # Let stderr pass through to terminal (preserves TTY for color detection)
- # Write exit code to temp file since it can't be captured from process substitution
- # The || [[ -n "$chunk" ]] handles non-NUL-terminated output (e.g., error messages)
- while IFS= read -r -d '' chunk || [[ -n "$chunk" ]]; do
- if [[ "$chunk" == __WORKTRUNK_CD__* ]]; then
- # CD directive - extract path and change directory
- local path="${chunk#__WORKTRUNK_CD__}"
- \cd "$path"
- elif [[ "$chunk" == __WORKTRUNK_EXEC__* ]]; then
- # EXEC directive - extract command (may contain newlines)
- exec_cmd="${chunk#__WORKTRUNK_EXEC__}"
- else
- # Regular output - print it with newline
- printf '%s\n' "$chunk"
- fi
- done < <(command "$_WORKTRUNK_CMD" "$@"; echo "$?" > "$exit_code_file")
-
- # Read exit code from temp file
- exit_code=$(cat "$exit_code_file" 2>/dev/null || echo 0)
-
- # Cleanup temp file
- \rm -f "$exit_code_file"
-
- # Execute command if one was specified
- # Security: Command is user-provided from -x flag; eval is intentional.
- # NUL-termination allows multi-line commands.
- # Exit code semantics: Returns wt's exit code, not the executed command's.
- # This allows detecting wt failures (e.g., branch creation errors).
- # The executed command runs for side effects; its failure is logged but doesn't affect exit code.
- if [[ -n "$exec_cmd" ]]; then
- if ! eval "$exec_cmd"; then
- echo "Warning: Command execution failed (exit code $?)" >&2
- fi
- fi
-
- return $exit_code
- }
-
- # Override wt command to add --internal flag for switch, remove, and merge
- wt() {
- local subcommand="$1"
-
- case "$subcommand" in
- switch|remove|merge)
- # Commands that need --internal for directory change support
- shift
- _wt_exec --internal "$subcommand" "$@"
- ;;
- *)
- # All other commands pass through directly
- command "$_WORKTRUNK_CMD" "$@"
- ;;
- esac
- }
-
- # Dynamic completion function
- _wt_complete() {
- local cur="${COMP_WORDS[COMP_CWORD]}"
-
- # Call wt complete with current command line
- local completions=$(command "$_WORKTRUNK_CMD" complete "${COMP_WORDS[@]}" 2>/dev/null)
- COMPREPLY=($(compgen -W "$completions" -- "$cur"))
- }
-
- # Register dynamic completion
- complete -F _wt_complete wt
-fi
-
-# Static completions (commands and flags)
-_wt() {
- local i cur prev opts cmd
- COMPREPLY=()
- if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then
- cur="$2"
- else
- cur="${COMP_WORDS[COMP_CWORD]}"
- fi
- prev="$3"
- cmd=""
- opts=""
-
- for i in "${COMP_WORDS[@]:0:COMP_CWORD}"
- do
- case "${cmd},${i}" in
- ",$1")
- cmd="wt"
- ;;
- wt,complete)
- cmd="wt__complete"
- ;;
- wt,completion)
- cmd="wt__completion"
- ;;
- wt,config)
- cmd="wt__config"
- ;;
- wt,configure-shell)
- cmd="wt__configure__shell"
- ;;
- wt,init)
- cmd="wt__init"
- ;;
- wt,list)
- cmd="wt__list"
- ;;
- wt,merge)
- cmd="wt__merge"
- ;;
- wt,push)
- cmd="wt__push"
- ;;
- wt,remove)
- cmd="wt__remove"
- ;;
- wt,switch)
- cmd="wt__switch"
- ;;
- wt__config,init)
- cmd="wt__config__init"
- ;;
- wt__config,list)
- cmd="wt__config__list"
- ;;
- *)
- ;;
- esac
- done
-
- case "${cmd}" in
- wt)
- opts="-v -h -V --verbose --help --version init configure-shell config list switch remove push merge completion complete"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- fi
- case "${prev}" in
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- ;;
- wt__complete)
- opts="-v -h --verbose --help [ARGS]..."
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- fi
- case "${prev}" in
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- ;;
- wt__completion)
- opts="-v -h --verbose --help bash elvish fish nushell oil powershell xonsh zsh"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- fi
- case "${prev}" in
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- ;;
- wt__config)
- opts="-v -h --verbose --help init list"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- fi
- case "${prev}" in
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- ;;
- wt__config__init)
- opts="-v -h --verbose --help"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- fi
- case "${prev}" in
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- ;;
- wt__config__list)
- opts="-v -h --verbose --help"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- fi
- case "${prev}" in
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- ;;
- wt__configure__shell)
- opts="-y -v -h --shell --cmd --yes --verbose --help"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- fi
- case "${prev}" in
- --shell)
- COMPREPLY=($(compgen -W "bash elvish fish nushell oil powershell xonsh zsh" -- "${cur}"))
- return 0
- ;;
- --cmd)
- COMPREPLY=($(compgen -f "${cur}"))
- return 0
- ;;
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- ;;
- wt__init)
- opts="-v -h --cmd --verbose --help <SHELL>"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- fi
- case "${prev}" in
- --cmd)
- COMPREPLY=($(compgen -f "${cur}"))
- return 0
- ;;
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- ;;
- wt__list)
- opts="-v -h --format --branches --verbose --help"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- fi
- case "${prev}" in
- --format)
- COMPREPLY=($(compgen -W "table json" -- "${cur}"))
- return 0
- ;;
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- ;;
- wt__merge)
- opts="-s -k -m -f -v -h --squash --keep --message --no-hooks --force --verbose --help [TARGET]"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- fi
- case "${prev}" in
- --message)
- COMPREPLY=($(compgen -f "${cur}"))
- return 0
- ;;
- -m)
- COMPREPLY=($(compgen -f "${cur}"))
- return 0
- ;;
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- ;;
- wt__push)
- opts="-v -h --allow-merge-commits --verbose --help [TARGET]"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- fi
- case "${prev}" in
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- ;;
- wt__remove)
- opts="-v -h --verbose --help [WORKTREES]..."
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- fi
- case "${prev}" in
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- ;;
- wt__switch)
- opts="-c -b -x -f -v -h --create --base --execute --force --no-hooks --verbose --help <BRANCH>"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- fi
- case "${prev}" in
- --base)
- COMPREPLY=($(compgen -f "${cur}"))
- return 0
- ;;
- -b)
- COMPREPLY=($(compgen -f "${cur}"))
- return 0
- ;;
- --execute)
- COMPREPLY=($(compgen -f "${cur}"))
- return 0
- ;;
- -x)
- COMPREPLY=($(compgen -f "${cur}"))
- return 0
- ;;
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- ;;
- esac
-}
-
-if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then
- complete -F _wt -o nosort -o bashdefault -o default wt
-else
- complete -F _wt -o bashdefault -o default wt
-fi
-
------ stderr -----
diff --git a/tests/snapshots/integration__integration_tests__init__init_powershell.snap b/tests/snapshots/integration__integration_tests__init__init_powershell.snap
deleted file mode 100644
index 8d97a11a1..000000000
--- a/tests/snapshots/integration__integration_tests__init__init_powershell.snap
+++ /dev/null
@@ -1,104 +0,0 @@
----
-source: tests/integration_tests/init.rs
-info:
- program: wt
- args:
- - init
- - powershell
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "150"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp4uhsS3/test-config.toml
----
-success: false
-exit_code: 1
------ stdout -----
-# worktrunk shell integration for PowerShell
-
-# Only initialize if wt is available
-if (Get-Command wt -ErrorAction SilentlyContinue) {
- # Use WORKTRUNK_BIN if set, otherwise default to 'wt'
- # This allows testing development builds: $env:WORKTRUNK_BIN = "./target/debug/wt"
- $script:_WORKTRUNK_CMD = if ($env:WORKTRUNK_BIN) { $env:WORKTRUNK_BIN } else { "wt" }
-
- # Helper function to parse wt output and handle directives
- # Directives are NUL-terminated to support multi-line commands
- function _wt_exec {
- param(
- [Parameter(ValueFromRemainingArguments=$true)]
- [string[]]$Arguments
- )
-
- # Capture stdout for directives, let stderr pass through to terminal
- # This preserves TTY for color detection
- $output = & $script:_WORKTRUNK_CMD @Arguments | Out-String
- $exitCode = $LASTEXITCODE
- $execCmd = ""
-
- # Split output on NUL bytes, process each chunk
- foreach ($chunk in ($output -split "`0")) {
- if ($chunk -match '^__WORKTRUNK_CD__') {
- # CD directive - extract path and change directory
- $path = $chunk -replace '^__WORKTRUNK_CD__', ''
- Set-Location $path
- } elseif ($chunk -match '^__WORKTRUNK_EXEC__') {
- # EXEC directive - extract command (may contain newlines)
- $execCmd = $chunk -replace '^__WORKTRUNK_EXEC__', ''
- } elseif ($chunk) {
- # Regular output - write it with newline
- # TODO: Use Write-Output instead of Write-Host for redirectable output
- Write-Host $chunk
- }
- }
-
- # Execute command if one was specified
- if ($execCmd) {
- Invoke-Expression $execCmd
- }
-
- # Return the exit code
- return $exitCode
- }
-
- # Override wt command to add --internal flag for switch, remove, and merge
- function wt {
- param(
- [Parameter(ValueFromRemainingArguments=$true)]
- [string[]]$Arguments
- )
-
- if ($Arguments.Count -eq 0) {
- & $script:_WORKTRUNK_CMD
- return $LASTEXITCODE
- }
-
- $subcommand = $Arguments[0]
-
- switch ($subcommand) {
- { $_ -in @("switch", "remove", "merge") } {
- # Commands that need --internal for directory change support
- $restArgs = $Arguments[1..($Arguments.Count-1)]
- $exitCode = _wt_exec --internal $subcommand @restArgs
- return $exitCode
- }
- default {
- # All other commands pass through directly
- & $script:_WORKTRUNK_CMD @Arguments
- return $LASTEXITCODE
- }
- }
- }
-}
-
-# Static completions (commands and flags)
-❌ Completion not yet supported for powershell
-
------ stderr -----
diff --git a/tests/snapshots/integration__integration_tests__init__init_xonsh.snap b/tests/snapshots/integration__integration_tests__init__init_xonsh.snap
deleted file mode 100644
index e925431e7..000000000
--- a/tests/snapshots/integration__integration_tests__init__init_xonsh.snap
+++ /dev/null
@@ -1,89 +0,0 @@
----
-source: tests/integration_tests/init.rs
-info:
- program: wt
- args:
- - init
- - xonsh
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "150"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmphHRzFG/test-config.toml
----
-success: false
-exit_code: 1
------ stdout -----
-# worktrunk shell integration for xonsh
-
-# Only initialize if wt is available
-import shutil
-import os
-if shutil.which("wt") is not None:
- # Use WORKTRUNK_BIN if set, otherwise default to 'wt'
- # This allows testing development builds: $WORKTRUNK_BIN = ./target/debug/wt
- _WORKTRUNK_CMD = os.environ.get('WORKTRUNK_BIN', 'wt')
-
- def _wt_exec(args):
- """Helper function to parse wt output and handle directives
- Directives are NUL-terminated to support multi-line commands"""
- # Capture full output including return code
- result = ![@(_WORKTRUNK_CMD) @(args)]
- exec_cmd = ""
-
- # Split output on NUL bytes, process each chunk
- if result.out:
- for chunk in result.out.split("\0"):
- if chunk.startswith("__WORKTRUNK_CD__"):
- # CD directive - extract path and change directory
- # TODO: Use str.replace instead of hard-coded offset (fragile if prefix changes)
- path = chunk[16:] # Remove prefix
- cd @(path)
- elif chunk.startswith("__WORKTRUNK_EXEC__"):
- # EXEC directive - extract command (may contain newlines)
- # TODO: Use str.replace instead of hard-coded offset (fragile if prefix changes)
- exec_cmd = chunk[18:] # Remove prefix
- elif chunk:
- # Regular output - print it with newline
- print(chunk)
-
- # Execute command if one was specified
- if exec_cmd:
- execx(exec_cmd)
-
- # Return the exit code
- # TODO: Add fallback for None: return result.returncode or 0
- return result.returncode
-
- def _wt_wrapper(args):
- """Override wt command to add --internal flag for switch, remove, and merge"""
- if not args:
- # No arguments, just run wt
- ![@(_WORKTRUNK_CMD)]
- return
-
- subcommand = args[0]
-
- if subcommand in ["switch", "remove", "merge"]:
- # Commands that need --internal for directory change support
- rest_args = args[1:]
- return _wt_exec(["--internal", subcommand] + rest_args)
- else:
- # All other commands pass through directly
- result = ![@(_WORKTRUNK_CMD) @(args)]
- return result.returncode
-
- # Register the alias
- aliases['wt'] = _wt_wrapper
-
-# Static completions (commands and flags)
-❌ Completion not yet supported for xonsh
-
------ stderr -----
diff --git a/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_with_message.snap b/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_with_message.snap
deleted file mode 100644
index d639a386b..000000000
--- a/tests/snapshots/integration__integration_tests__merge__merge_auto_commit_with_message.snap
+++ /dev/null
@@ -1,47 +0,0 @@
----
-source: tests/integration_tests/merge.rs
-info:
- program: wt
- args:
- - merge
- - main
- - "-m"
- - Complete the user dashboard feature
- env:
- CLICOLOR_FORCE: "1"
- COLUMNS: "150"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_CONFIG_GLOBAL: /dev/null
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_EDITOR: ""
- LANG: C
- LC_ALL: C
- SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_COMMIT_GENERATION__ARGS: "feat: complete user dashboard"
- WORKTRUNK_COMMIT_GENERATION__COMMAND: echo
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpMMJ21f/test-config.toml
----
-success: true
-exit_code: 0
------ stdout -----
-πŸ”„ Committing uncommitted changes... (1 file, +1, -1)
-πŸ”„ Generating commit message...
-  WIP: Auto-commit before merge
-
-βœ… Committed changes (1 file, +1, -1) @ [SHA]
-πŸ”„ Rebasing onto main...
-πŸ”„ Merging 2 commits to main @ [SHA]
-
-* [SHA] (HEAD -> feature) WIP: Auto-commit before merge
-* [SHA] feat: start feature
-
- feature.txt | 1 +
- 1 file changed, 1 insertion(+)
-
-βœ… Merged to main (2 commits, 1 file, +1) 
-πŸ”„ Cleaning up worktree...
-
-βœ… Returned to primary at [REPO]
-
------ stderr -----