Skip to content

Commit

Permalink
Fix: "eval set" called in the wrong context.
Browse files Browse the repository at this point in the history
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 nvie#54 and nvie#86.
  • Loading branch information
nvie committed Feb 3, 2011
1 parent f1eaa4e commit 68e53aa
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions git-flow-feature
Expand Up @@ -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
Expand Down

0 comments on commit 68e53aa

Please sign in to comment.