From 369181e7058d843e36177d080fd5b436bca325e2 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Mon, 11 May 2026 20:04:11 -0400 Subject: [PATCH] fix stash: only pop if we actually stashed --- install_nvchad.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/install_nvchad.sh b/install_nvchad.sh index 8ab096c..0eaa314 100755 --- a/install_nvchad.sh +++ b/install_nvchad.sh @@ -46,9 +46,13 @@ if [ -d "$NVIM_CONFIG/.git" ]; then EXISTING_REMOTE=$(git -C "$NVIM_CONFIG" remote get-url "$REMOTE_NAME" 2>/dev/null || echo "") if [ "$EXISTING_REMOTE" = "$REPO" ]; then echo "NvChad config already installed — pulling latest..." - git -C "$NVIM_CONFIG" stash + local stashed=false + if ! git -C "$NVIM_CONFIG" diff --quiet || ! git -C "$NVIM_CONFIG" diff --cached --quiet; then + git -C "$NVIM_CONFIG" stash + stashed=true + fi git -C "$NVIM_CONFIG" pull "$REMOTE_NAME" "$BRANCH" - git -C "$NVIM_CONFIG" stash pop 2>/dev/null || true + $stashed && git -C "$NVIM_CONFIG" stash pop || true deploy_nvim echo "Done." exit 0