summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xupdate10
1 files changed, 5 insertions, 5 deletions
diff --git a/update b/update
index 5f1efd4..70f745b 100755
--- a/update
+++ b/update
@@ -7,7 +7,7 @@ config="$(dirname "$(readlink -f "$0")")"/sh.conf
[ -r "$config" ] && source "$config"
reponame="$(readlink -f .)"
-reponame="${reponame%/.git}"
+#reponame="${reponame%/.git}"
reponame="${reponame#/home/}"
FORMAT="%C(auto)%h by %an (%ah: %s) sig: %G? %GS 0x%GK https://cgit.space/$reponame/commit/?id=%h"
@@ -23,9 +23,9 @@ protectedRefs="$(git config --default "$default_branch_path" hooks.protectedRefs
commits=""
forced=""
-if [ "$old" = "0000000000000000000000000000000000000000" ]; then # new branch
+if ((16#$old == 0)); then # new branch
commits="created with $(git describe --always "$new")"
-elif [ "$new" = "0000000000000000000000000000000000000000" ]; then # deleted branch
+elif ((16#$new == 0)); then # deleted branch
commits="deleted from $(git describe --always "$old")"
elif [ "$old" = "$(git merge-base "$old" "$new")" ]; then # fast-forward update
commits="updated from $(git describe --always "$old") -> $(git describe --always "$new")"
@@ -40,8 +40,8 @@ fi
#curl -sS -d "[$reponame] $ref $commits" "$H2I" >/dev/null
echo "[$reponame] $ref $commits" | "${NC[@]}" >/dev/null
-if [ "$old" = "0000000000000000000000000000000000000000" ]; then
- git show --no-show-signature --no-patch --pretty="tformat:$FORMAT" "$new"
+if ((16#$old == 0)); then
+ git log --no-show-signature --no-patch --pretty="tformat:$FORMAT" "$new"
else
git log --no-show-signature --pretty="tformat:$FORMAT" "$old".."$new"
fi | while read line; do