Permalink
Browse files

Fix: "eval set" called in the wrong context.

This is the real fix for the incorrect fix that I reverted in the
previous commit.  parse_cmdline was used to DRY up the source, but this
introduced a bug because the "eval set" line changes the positional
parameters semantics, but does it in the wrong context, so the calling
function never receives the changes.

This closes at least the GitHub issues #54 and #86.
  • Loading branch information...
1 parent f1eaa4e commit 68e53aae80f9b3b74edffd1ecb5458063bb9d6ed @nvie committed Feb 3, 2011
Showing with 4 additions and 6 deletions.
  1. +4 −6 git-flow-feature
View
10 git-flow-feature
@@ -170,22 +170,20 @@ name_or_current() {
fi
}
-parse_cmdline() {
+parse_args() {
# parse options
FLAGS "$@" || exit $?
eval set -- "${FLAGS_ARGV}"
-}
-
-parse_args() {
- parse_cmdline "$@"
# read arguments into global variables
NAME=$1
BRANCH=$PREFIX$NAME
}
parse_remote_name() {
- parse_cmdline "$@"
+ # parse options
+ FLAGS "$@" || exit $?
+ eval set -- "${FLAGS_ARGV}"
# read arguments into global variables
REMOTE=$1

0 comments on commit 68e53aa

Please sign in to comment.