Skip to content

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

fix(docs): stop move-changes after stash failures (#4678)

Worktrunk Bota8d0fdf84c63
diff --git a/docs/src/content/docs/extending.md b/docs/src/content/docs/extending.md
index 2383dbdd8..c3b392114 100644
--- a/docs/src/content/docs/extending.md
+++ b/docs/src/content/docs/extending.md
@@ -160,9 +160,9 @@ if git diff --quiet HEAD && test -z "$(git ls-files --others --exclude-standard)
wt switch --create {{ to }} --execute sh -- -c \
'if [ "$#" -gt 0 ]; then exec "$@"; fi' worktrunk-move {{ args }}
else
- git stash push --include-untracked --quiet
+ git stash push --include-untracked --quiet || exit
wt switch --create {{ to }} --execute sh -- -c \
- 'git stash pop --index; if [ "$#" -gt 0 ]; then exec "$@"; fi' worktrunk-move {{ args }}
+ 'git stash pop --index || exit; if [ "$#" -gt 0 ]; then exec "$@"; fi' worktrunk-move {{ args }}
fi
'''
```
diff --git a/plugins/worktrunk/skills/worktrunk/reference/extending.md b/plugins/worktrunk/skills/worktrunk/reference/extending.md
index d499c767e..72e5acb9a 100644
--- a/plugins/worktrunk/skills/worktrunk/reference/extending.md
+++ b/plugins/worktrunk/skills/worktrunk/reference/extending.md
@@ -156,9 +156,9 @@ if git diff --quiet HEAD && test -z "$(git ls-files --others --exclude-standard)
wt switch --create {{ to }} --execute sh -- -c \
'if [ "$#" -gt 0 ]; then exec "$@"; fi' worktrunk-move {{ args }}
else
- git stash push --include-untracked --quiet
+ git stash push --include-untracked --quiet || exit
wt switch --create {{ to }} --execute sh -- -c \
- 'git stash pop --index; if [ "$#" -gt 0 ]; then exec "$@"; fi' worktrunk-move {{ args }}
+ 'git stash pop --index || exit; if [ "$#" -gt 0 ]; then exec "$@"; fi' worktrunk-move {{ args }}
fi
'''
```
diff --git a/skills/worktrunk/reference/extending.md b/skills/worktrunk/reference/extending.md
index d499c767e..72e5acb9a 100644
--- a/skills/worktrunk/reference/extending.md
+++ b/skills/worktrunk/reference/extending.md
@@ -156,9 +156,9 @@ if git diff --quiet HEAD && test -z "$(git ls-files --others --exclude-standard)
wt switch --create {{ to }} --execute sh -- -c \
'if [ "$#" -gt 0 ]; then exec "$@"; fi' worktrunk-move {{ args }}
else
- git stash push --include-untracked --quiet
+ git stash push --include-untracked --quiet || exit
wt switch --create {{ to }} --execute sh -- -c \
- 'git stash pop --index; if [ "$#" -gt 0 ]; then exec "$@"; fi' worktrunk-move {{ args }}
+ 'git stash pop --index || exit; if [ "$#" -gt 0 ]; then exec "$@"; fi' worktrunk-move {{ args }}
fi
'''
```