Reset GIT_REPO_INFO[6] after prefetch.
This commit is contained in:
parent
56ecba9df9
commit
635dc5d53b
1 changed files with 5 additions and 1 deletions
6
.bashrc
6
.bashrc
|
@ -79,7 +79,11 @@ __prompt_git_status() {
|
||||||
[[ -n "$GIT_PROMPT_AUTO_PREFETCH" ]] && {
|
[[ -n "$GIT_PROMPT_AUTO_PREFETCH" ]] && {
|
||||||
# Only prefetch remotes if in the top-level working directory and if the repository is configured for maintenance work.
|
# Only prefetch remotes if in the top-level working directory and if the repository is configured for maintenance work.
|
||||||
[[ "$PWD" == "${GIT_REPO_INFO[0]}" ]] && git config --global --get --fixed-value maintenance.repo "$PWD" >/dev/null 2>&1 && {
|
[[ "$PWD" == "${GIT_REPO_INFO[0]}" ]] && git config --global --get --fixed-value maintenance.repo "$PWD" >/dev/null 2>&1 && {
|
||||||
git maintenance run --task=prefetch 2>/dev/null || printf "\\033[1;31m%s\\033[39m\\n" "Git maintenance 'prefetch' task failed." >&2
|
if git maintenance run --task=prefetch 2>/dev/null; then
|
||||||
|
GIT_REPO_INFO[6]="$(git rev-parse --glob=prefetch)"
|
||||||
|
else
|
||||||
|
printf "\\033[1;31m%s\\033[39m\\n" "Git maintenance 'prefetch' task failed." >&2
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
COUNT="$(git rev-list --count --left-right "${GIT_REPO_INFO[6]:-@{upstream\}}...HEAD" 2>/dev/null | tr '[:blank:]' ' ')"
|
COUNT="$(git rev-list --count --left-right "${GIT_REPO_INFO[6]:-@{upstream\}}...HEAD" 2>/dev/null | tr '[:blank:]' ' ')"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue