From b6c3fa7d496813de01707ddcc0f6a8fc33597228 Mon Sep 17 00:00:00 2001 From: Alad Wenter Date: Sun, 26 May 2024 15:13:18 +0200 Subject: [PATCH] `view`: use empty tree instead of exiting on invalid revision Closes #1162 --- lib/aur-view | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/aur-view b/lib/aur-view index 28a440b3..e24eaca2 100755 --- a/lib/aur-view +++ b/lib/aur-view @@ -130,7 +130,8 @@ for pkg in "${packages[@]}"; do # Check if hash points to an existing object if ! git cat-file -e "$view"; then printf >&2 '%s: %s: invalid git revision\n' "$argv0" "$AUR_VIEW_DB/$pkg" - exit 22 + printf >&2 '%s: %s: falling back to empty tree\n' "$argv0" "$AUR_VIEW_DB/$pkg" + view=$(git hash-object -t tree /dev/null) fi if [[ $view != "$head" ]]; then -- 2.11.4.GIT