diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2019-07-17 14:31:39 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2019-07-17 15:33:22 +0100 |
commit | 91276fec6bc5746021ad69fd1bc1c2e3d72df4a0 (patch) | |
tree | fc74dfaa3357d51193708e8590209cc597718e89 | |
parent | 5075bc0cd642feb92c446d799e137e4b0d769de2 (diff) |
git-debpush: refactor to avoid more than one push command
No functional change.
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rwxr-xr-x | git-debpush | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/git-debpush b/git-debpush index 39ff410..0ddbfc4 100755 --- a/git-debpush +++ b/git-debpush @@ -140,7 +140,7 @@ esac # ---- Gather git information remoteconfigs=() -push_branch=() +to_push=() # Maybe $branch is a symbolic ref. If so, resolve it branchref="$(git symbolic-ref -q $branch || test $? = 1)" @@ -167,7 +167,7 @@ esac case "$branch" in refs/heads/*) b=${branch#refs/heads/} - push_branch+=("$b") + to_push+=("$b") remoteconfigs+=( branch.$b.pushRemote branch.$b.remote ) ;; esac @@ -244,6 +244,7 @@ if $upstream; then fi upstream_committish=$(git rev-parse "refs/tags/${upstream_tag}"^{}) upstream_info=" upstream-tag=$upstream_tag upstream=$upstream_committish" + to_push+=("$upstream_tag") fi # ---- Useful sanity checks @@ -296,6 +297,7 @@ fi git_version=$(echo $version | tr ':~' '%_' | sed 's/\.(?=\.|$|lock$)/.#/g') debian_tag="$distro/$git_version" +to_push+=("$debian_tag") # If the user didn't supply a quilt mode, look for it in a previous # tag made by this script @@ -331,9 +333,5 @@ EOF # ---- Do a git push if $pushing; then - if [ "x$upstream_tag" = "x" ]; then - git push "$remote" "${push_branch[@]}" "$debian_tag" - else - git push "$remote" "${push_branch[@]}" "$debian_tag" "$upstream_tag" - fi + git push "$remote" "${to_push[@]}" fi |