]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
scripts/git: Pass all unrecognised arguments to git-push-all.sh
authorteor <teor@torproject.org>
Wed, 23 Oct 2019 02:58:15 +0000 (12:58 +1000)
committerteor <teor@torproject.org>
Wed, 23 Oct 2019 03:04:28 +0000 (13:04 +1000)
This makes the behaviour of git-push-all.sh -n identical to the other
git scripts.

Part of 32216.

scripts/git/git-push-all.sh

index 7e67f4c96da389d8bd75a0048094289b4e268f0e..1b20a50b7f6c1e58dfc477401fdbf30d682703d5 100755 (executable)
@@ -29,6 +29,8 @@ function usage()
   echo "       CI environment failures, using code that previously passed CI."
   echo "       (default: skip; current: $CURRENT_PUSH_SAME matching branches)"
   echo "   --: pass further arguments to git push."
+  echo "       All unrecognised arguments are passed to git push, but complex"
+  echo "       arguments before -- may be mangled by getopt."
   echo "       (default: git push --atomic, current: $GIT_PUSH)"
   echo
   echo " env vars:"
@@ -127,9 +129,11 @@ while getopts ":hr:st:" opt; do
        OPTIND=$((OPTIND - 2))
        ;;
     *)
-       # Assume we're done with script arguments,
-       # and git push will handle the option
-       break
+       # Make git push handle the option
+       # This might mangle options with spaces, use -- for complex options
+       GIT_PUSH="$GIT_PUSH $1"
+       shift
+       OPTIND=$((OPTIND - 1))
        ;;
   esac
 done