aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfgang Müller2021-07-04 13:13:27 +0200
committerWolfgang Müller2021-07-04 13:13:27 +0200
commitd330c4c0a01d1a61d0983ab2a2eb30befb7d9858 (patch)
treeff7643f992f0bc3f1b9f720581adfebd71713276
parent8643238ec04da8d0bda46cb06ecd29dc88f9d243 (diff)
downloadgit-helpers-d330c4c0a01d1a61d0983ab2a2eb30befb7d9858.tar.gz
Do not exit if package.format is unset
Both git-package(1) and git-sign-for-cgit(1) set 'errexit', making the shell exit immediately upon an error. Since git-config(1) exits with an error if a configuration entry could not be found, a missing entry for package.format would lead to both scripts bailing out. We want to fall back to the "tar.gz" format if package.format is unset, so make sure to ignore this particular error.
-rwxr-xr-xgit-package2
-rwxr-xr-xgit-sign-for-cgit2
2 files changed, 2 insertions, 2 deletions
diff --git a/git-package b/git-package
index 4becad9..2bdfce4 100755
--- a/git-package
+++ b/git-package
@@ -13,7 +13,7 @@ usage() {
errx 'usage: git package [-f format] tree-ish [path...]'
}
-format="$(git config --get package.format)"
+format="$(git config --get package.format)" || true
: "${format:=tar.gz}"
while getopts f: opt; do
diff --git a/git-sign-for-cgit b/git-sign-for-cgit
index 6fc7311..2acdd5f 100755
--- a/git-sign-for-cgit
+++ b/git-sign-for-cgit
@@ -13,7 +13,7 @@ usage() {
seckey=${SIGNIFY_SECKEY:-$HOME/.signify/release.sec}
-format="$(git config --get package.format)"
+format="$(git config --get package.format)" || true
: "${format:=tar.gz}"
while getopts f: opt; do