aboutsummaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
authorThéo Zimmermann2020-05-23 13:19:26 +0200
committerThéo Zimmermann2020-05-23 13:19:26 +0200
commitdbefe0718913318b20d2c56e2ed026c638897a26 (patch)
tree0f59e8edb6a40e7cadc250e66c04dc1ac6d90800 /dev
parent59e7a45961a1ee1755df02512120c0b5bafe08ce (diff)
[dev/tools] Fix #12314: do not die silently if branch has no remote.
Diffstat (limited to 'dev')
-rwxr-xr-xdev/tools/backport-pr.sh2
-rwxr-xr-xdev/tools/generate-release-changelog.sh4
-rwxr-xr-xdev/tools/merge-pr.sh2
3 files changed, 4 insertions, 4 deletions
diff --git a/dev/tools/backport-pr.sh b/dev/tools/backport-pr.sh
index b1d2fd656a..3fdc82b81b 100755
--- a/dev/tools/backport-pr.sh
+++ b/dev/tools/backport-pr.sh
@@ -30,7 +30,7 @@ while [[ $# -gt 0 ]]; do
esac
done
-REMOTE=$(git config --get "branch.master.remote")
+REMOTE=$(git config --get "branch.master.remote" || true)
if [ -z "$REMOTE" ]; then
echo "Branch master has no remote. Using the local state of the master branch instead."
MASTER=master
diff --git a/dev/tools/generate-release-changelog.sh b/dev/tools/generate-release-changelog.sh
index 5b2d749b66..4533d39adc 100755
--- a/dev/tools/generate-release-changelog.sh
+++ b/dev/tools/generate-release-changelog.sh
@@ -31,14 +31,14 @@ if ! git diff --quiet; then
ask_confirmation
fi
-remote=$(git config --get "branch.${branch}.remote")
+remote=$(git config --get "branch.${branch}.remote" || true)
if [ -z "$remote" ]; then
echo "Warning: branch $branch has no associated remote."
ask_confirmation
else
- if [ "$remote" != $(git config --get "branch.master.remote") ]; then
+ if [ "$remote" != $(git config --get "branch.master.remote" || true) ]; then
echo "Warning: branch master and branch $branch do not have the same remote."
ask_confirmation
fi
diff --git a/dev/tools/merge-pr.sh b/dev/tools/merge-pr.sh
index 82e4bd1e1e..7b450c3e53 100755
--- a/dev/tools/merge-pr.sh
+++ b/dev/tools/merge-pr.sh
@@ -99,7 +99,7 @@ info "PR $PR targets branch $BASE_BRANCH"
CURRENT_LOCAL_BRANCH=$(git rev-parse --abbrev-ref HEAD)
info "you are merging in $CURRENT_LOCAL_BRANCH"
-REMOTE=$(git config --get "branch.$CURRENT_LOCAL_BRANCH.remote")
+REMOTE=$(git config --get "branch.$CURRENT_LOCAL_BRANCH.remote" || true)
if [ -z "$REMOTE" ]; then
error "branch $CURRENT_LOCAL_BRANCH has not associated remote"
error "don't know where to fetch the PR from"