aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--git-snapsign8
1 files changed, 5 insertions, 3 deletions
diff --git a/git-snapsign b/git-snapsign
index 85fd9a3..a9a53b4 100644
--- a/git-snapsign
+++ b/git-snapsign
@@ -91,12 +91,14 @@ check_format() {
}
check_notes() {
- if ! git show-ref --quiet --verify -- "refs/notes" >/dev/null 2>&1; then
- git config --add remote.origin.fetch "+refs/notes/*:refs/notes/*" >/dev/null 2>&1
+ mapfile -d '\0' signatures < <(find .git/refs/notes -type f 2>/dev/null)
+ if [[ $(echo ${#signatures[@]}) != 0 ]]; then
git fetch >/dev/null 2>&1
else
- git fetch >/dev/null 2>&1
+ git config --add remote.origin.fetch "+refs/notes/*:refs/notes/*" >/dev/null 2>&1
+ git fetch origin refs/notes/*:refs/notes/* >/dev/null 2>&1
fi
+ unset signatures
}
#---------