From c8c9d887f59ea2be9c715cd2b45afb6b0a3ad766 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Wed, 29 Jan 2025 14:26:31 +0100 Subject: [PATCH] git:checkout-worktree: Echo non-zero exit code --- .config/zsh/autoload/git/git-checkout-worktree | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/zsh/autoload/git/git-checkout-worktree b/.config/zsh/autoload/git/git-checkout-worktree index c5fcda0..746d50d 100755 --- a/.config/zsh/autoload/git/git-checkout-worktree +++ b/.config/zsh/autoload/git/git-checkout-worktree @@ -54,12 +54,14 @@ trap ' pushd -q "$WORKTREE_PATH" "$SHELL" && errc=$? || errc=$? +(( !errc )) || echo "shell exited with $errc" # Restart the shell (forcefully interactive) until the worktree is removed until [[ ! -e "$WORKTREE_PATH" ]] || git worktree remove "$WORKTREE_PATH"; do [[ -t 0 ]] || >&2 printf "Dropping into interactive shell to resolve conflicts\n" "$SHELL" -i && errc=$? || errc=$? + (( !errc )) || echo "shell exited with $errc" done # Reset traps and PWD