summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-debpush19
1 files changed, 17 insertions, 2 deletions
diff --git a/git-debpush b/git-debpush
index 5ffbd52..ae5f20f 100755
--- a/git-debpush
+++ b/git-debpush
@@ -216,8 +216,23 @@ esac
upstream_info=""
if $upstream; then
if [ "x$upstream_tag" = x ]; then
- upstream_tag=$(git deborig --just-print --version="$version" \
- | head -n1)
+ upstream_tag=$(
+ set +e
+ git deborig --just-print --version="$version" \
+ | head -n1
+ ps="${PIPESTATUS[*]}"
+ set -e
+ case "$ps" in
+ "0 0"|"141 0") ;; # ok or SIGPIPE
+ *" 0")
+ echo >&2 \
+ "$us: git-deborig failed; maybe try $us --upstream=TAG"
+ exit 0
+ ;;
+ *) exit 127; # presumably head will have complained
+ esac
+ )
+ if [ "x$upstream_tag" = x ]; then exit 127; fi
fi
upstream_committish=$(git rev-parse "refs/tags/${upstream_tag}"^{})
upstream_info=" upstream-tag=$upstream_tag upstream=$upstream_committish"