Do prefetch in any part of repo, not just the root.

This commit is contained in:
Darren 'Tadgy' Austin 2023-10-20 20:23:10 +01:00
commit 42ba53f0f8

View file

@ -66,8 +66,7 @@ __prompt_git_status() {
# Add upstream status.
[[ -n "$GIT_PROMPT_SHOW_UPSTREAM" ]] || [[ -n "$GIT_PROMPT_SHOW_UPSTREAM_EXTENDED" ]] && {
# Whether to run prefetch tasks.
[[ -n "$GIT_PROMPT_AUTO_PREFETCH" ]] && [[ "$PWD" == "${GIT_REPO_INFO[0]}" ]] && \
[[ "$(git config --get --bool maintenance.promptprefetchdisabled 2>/dev/null)" != "true" ]] && {
[[ -n "$GIT_PROMPT_AUTO_PREFETCH" ]] && [[ "$(git config --get --bool maintenance.promptprefetchdisabled 2>/dev/null)" != "true" ]] && {
git maintenance run --task=prefetch 2>/dev/null || printf "\\033[1;31m%s\\033[39m\\n" "Git maintenance 'prefetch' task failed." >&2
}
COUNT="$(git rev-list --count --left-right "${BRANCH:+refs/prefetch/remotes/origin/}${BRANCH:-@{upstream\}}...HEAD" 2>/dev/null | tr '[:blank:]' ' ')"