From 6b789c8bd6f87136863ae89f5f9fc8c95688c524 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 6 Sep 2026 15:49:09 +0000 Subject: [PATCH] fix(git plugin): include git exec path in version cache key Co-authored-by: robbyrussell <257+robbyrussell@users.noreply.github.com> --- plugins/git/git.plugin.zsh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 4273613b4..f5e72a922 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -1,13 +1,14 @@ # Git version checking autoload -Uz is-at-least # Running `git version` forks on every startup, so cache the result for a day -# in $ZSH_CACHE_DIR, keyed on the git binary's path and mtime. +# in $ZSH_CACHE_DIR, keyed on the git command path, mtime, and exec path. () { - local cache="$ZSH_CACHE_DIR/git-version" key + local cache="$ZSH_CACHE_DIR/git-version" key exec_path local -a stat lines zmodload -F zsh/stat b:zstat zstat -A stat +mtime -- "$commands[git]" 2>/dev/null - key="$commands[git] $stat[1]" + exec_path="$(git --exec-path 2>/dev/null)" + key="$commands[git] $stat[1] $exec_path" lines=("$cache"(Nm-1)) (( $#lines )) && lines=("${(@f)$(<"$cache")}")