aboutsummaryrefslogtreecommitdiffstats
path: root/example_post-receive.sh
diff options
context:
space:
mode:
authorHiltjo Posthuma <[email protected]>2017-08-09 18:52:53 +0200
committerHiltjo Posthuma <[email protected]>2017-08-09 18:52:53 +0200
commit8787f495e09fd3857fd4bbbb7c32784f86787df6 (patch)
treedbb6c26a99cfb3fee05baa314b9c374e5fd618ac /example_post-receive.sh
parent304d095d3d31cee82ac1b868d912abb946cef6b9 (diff)
downloadstagit-8787f495e09fd3857fd4bbbb7c32784f86787df6.tar.gz
stagit-8787f495e09fd3857fd4bbbb7c32784f86787df6.zip
remote: fatal: bad object 0000000000000000000000000000000000000000 this can happen on initial repos or when pushing tags etc.
Diffstat (limited to 'example_post-receive.sh')
-rwxr-xr-xexample_post-receive.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/example_post-receive.sh b/example_post-receive.sh
index 5f827e1..ba87e51 100755
--- a/example_post-receive.sh
+++ b/example_post-receive.sh
@@ -32,6 +32,8 @@ cd "${dir}" || exit 1
# detect git push -f
force=0
while read -r old new ref; do
+ test "${old}" = "0000000000000000000000000000000000000000" && continue
+
hasrevs=$(git rev-list "${old}" "^${new}" | sed 1q)
if test -n "${hasrevs}"; then
force=1