summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParabola git <git@parabola.nu>2020-12-15 13:00:02 +0000
committerParabola git <git@parabola.nu>2020-12-15 13:00:02 +0000
commit06bbc82ab63f9487e58a05e86f9ba25adf96bbca (patch)
tree07e6065c81b0f63dbffec2b06084a81ce742b0fd
parent59b3982ba6ae2516915e53668a5eb8971a1d3cde (diff)
Update from cron
-rwxr-xr-x.config/git/hooks/run-parts.sh4
l---------.config/git/hooks/update.d/.#per-branch-no-ff1
-rwxr-xr-x.config/git/hooks/update.d/per-branch-no-ff8
3 files changed, 6 insertions, 7 deletions
diff --git a/.config/git/hooks/run-parts.sh b/.config/git/hooks/run-parts.sh
index d2a1e0b..c1692b1 100755
--- a/.config/git/hooks/run-parts.sh
+++ b/.config/git/hooks/run-parts.sh
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
if [[ -d "$0.d" ]]; then
- run-parts "${@/#/--arg=}" -- "$0.d"
+ run-parts "${@/#/--arg=}" --exit-on-error -- "$0.d" || exit 1
fi
file="$GIT_DIR/hooks/${0##*/}"
if [[ -x "$file" && -f "$file" ]]; then
- "$file" "$@"
+ "$file" "$@" || exit 1
fi
diff --git a/.config/git/hooks/update.d/.#per-branch-no-ff b/.config/git/hooks/update.d/.#per-branch-no-ff
new file mode 120000
index 0000000..6da72b0
--- /dev/null
+++ b/.config/git/hooks/update.d/.#per-branch-no-ff
@@ -0,0 +1 @@
+root@winston.parabola.nu.1126808 \ No newline at end of file
diff --git a/.config/git/hooks/update.d/per-branch-no-ff b/.config/git/hooks/update.d/per-branch-no-ff
index a459a62..1e40921 100755
--- a/.config/git/hooks/update.d/per-branch-no-ff
+++ b/.config/git/hooks/update.d/per-branch-no-ff
@@ -4,11 +4,9 @@ ref=$1
prev_sha=$2
next_sha=$3
-
-echo "ref=$ref prev_sha=${prev_sha} next_sha=${next_sha}" >> ~git/update-hook.log
-exit 1
-
# prevent re-writing history on master branch
# autobuilder can not handle non-fast-forward commits
-[[ "${ref}" != 'master' ]] || \
+[[ "${ref}" != 'refs/heads/master' ]] || \
git merge-base --is-ancestor "${prev_sha}" "${next_sha}"
+
+exit $?