Git fork

contrib/subtree: parse using --stuck-long

Optional parameter handling only works unambiguous with git rev-parse
--parseopt when using the --stuck-long option. To prepare for future commits
which add flags with optional parameters, parse with --stuck-long.

Signed-off-by: Patrik Weiskircher <patrik@pspdfkit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Patrik Weiskircher and committed by
Junio C Hamano
7cd080ac b07857f7

+13 -21
+13 -21
contrib/subtree/git-subtree.sh
··· 115 115 then 116 116 set -- -h 117 117 fi 118 - set_args="$(echo "$OPTS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)" 118 + set_args="$(echo "$OPTS_SPEC" | git rev-parse --parseopt --stuck-long -- "$@" || echo exit $?)" 119 119 eval "$set_args" 120 120 . git-sh-setup 121 121 require_work_tree ··· 131 131 opt="$1" 132 132 shift 133 133 case "$opt" in 134 - --annotate|-b|-P|-m|--onto) 135 - shift 136 - ;; 137 134 --rejoin) 138 135 arg_split_rejoin=1 139 136 ;; ··· 177 174 shift 178 175 179 176 case "$opt" in 180 - -q) 177 + --quiet) 181 178 arg_quiet=1 182 179 ;; 183 - -d) 180 + --debug) 184 181 arg_debug=1 185 182 ;; 186 - --annotate) 183 + --annotate=*) 187 184 test -n "$allow_split" || die_incompatible_opt "$opt" "$arg_command" 188 - arg_split_annotate="$1" 189 - shift 185 + arg_split_annotate="${opt#*=}" 190 186 ;; 191 187 --no-annotate) 192 188 test -n "$allow_split" || die_incompatible_opt "$opt" "$arg_command" 193 189 arg_split_annotate= 194 190 ;; 195 - -b) 191 + --branch=*) 196 192 test -n "$allow_split" || die_incompatible_opt "$opt" "$arg_command" 197 - arg_split_branch="$1" 198 - shift 193 + arg_split_branch="${opt#*=}" 199 194 ;; 200 - -P) 201 - arg_prefix="${1%/}" 202 - shift 195 + --prefix=*) 196 + arg_prefix="${opt#*=}" 203 197 ;; 204 - -m) 198 + --message=*) 205 199 test -n "$allow_addmerge" || die_incompatible_opt "$opt" "$arg_command" 206 - arg_addmerge_message="$1" 207 - shift 200 + arg_addmerge_message="${opt#*=}" 208 201 ;; 209 202 --no-prefix) 210 203 arg_prefix= 211 204 ;; 212 - --onto) 205 + --onto=*) 213 206 test -n "$allow_split" || die_incompatible_opt "$opt" "$arg_command" 214 - arg_split_onto="$1" 215 - shift 207 + arg_split_onto="${opt#*=}" 216 208 ;; 217 209 --no-onto) 218 210 test -n "$allow_split" || die_incompatible_opt "$opt" "$arg_command"