From 5adad9a87413194e1cf86462edae13fdb9f1fa36 Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Fri, 23 Aug 2024 23:47:01 +0100 Subject: [PATCH] Use a timeout when doing a git merge in the prompt command. --- .bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index cb530f5..69c11c7 100644 --- a/.bashrc +++ b/.bashrc @@ -177,7 +177,7 @@ __git_prompt_command() { [[ "${GIT_REPO_INFO[0]}" == "true" ]] && { # Run prefetch tasks if not disabled. [[ -z "$GIT_DISABLE_PROMPT_PREFETCH" ]] && [[ "$(git config --local --get --type bool script.DisablePromptPrefetch 2>/dev/null)" != "true" ]] && { - git maintenance run --task=prefetch 2>/dev/null || { + timeout --signal=KILL 7s git maintenance run --task=prefetch 2>/dev/null || { printf "\\033[1;31m%s\\033[0m\\n" "Git maintenance 'prefetch' task failed." >&2 return 1 }