From cc117cc2d15e17cd566c36925d33615182db7c6e Mon Sep 17 00:00:00 2001 From: Jeremy McClure Date: Sat, 1 Aug 2026 16:49:02 -0400 Subject: [PATCH] fix: always cd to home after dotstate_update --- default/.config/zsh/functions.zsh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/default/.config/zsh/functions.zsh b/default/.config/zsh/functions.zsh index 747a1ea..48d1f13 100644 --- a/default/.config/zsh/functions.zsh +++ b/default/.config/zsh/functions.zsh @@ -18,15 +18,14 @@ dotstate_update() { [[ "$(id -u)" -ne "$(stat -c '%u' "$TARGET_DIR" 2>/dev/null)" ]] && return 0 [[ ! -d "$TARGET_DIR/.git" ]] && return 0 - local orig_dir="$PWD" cd "$TARGET_DIR" || return 0 local remote_sha local_sha remote_sha=$(timeout 5 git ls-remote "$REPO_URL" HEAD | awk '{print $1}') - [[ -z "$remote_sha" ]] && { cd "$orig_dir"; return 0; } + [[ -z "$remote_sha" ]] && { cd ~; return 0; } local_sha=$(git rev-parse HEAD) if [[ "$remote_sha" == "$local_sha" ]]; then - cd "$orig_dir" + cd ~ return 0 fi