From 36f29274619d02cf41cc33395d8bd12b5957ec3b Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 5 Nov 2024 18:38:45 +0100 Subject: do not wait for git indefinitely --- computer-time-limit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/computer-time-limit b/computer-time-limit index 00d4c86..91b8bce 100755 --- a/computer-time-limit +++ b/computer-time-limit @@ -6,7 +6,7 @@ url='https://eckner.net/computer-time-limit.php' lock_file=~/.computer-time-limit.lock if [ -d "${dir}"'/.git' ] && [ $# -eq 0 ] && [ "$(stat -c%U "${dir}"'/.git')" = "$(whoami)" ]; then - git -C "${dir}" fetch --all -p 2>/dev/null + timeout 60 git -C "${dir}" fetch --all -p 2>/dev/null if [ -z "$(git -C "${dir}" status --porcelain)" ]; then git -C "${dir}" pull --ff-only 2>/dev/null exec "$0" '-' -- cgit v1.2.3-70-g09d2