Don't just take the last argument, take the first.
This patch was originally contributed as a workaround for the cases
where there were flags that took the first argument position. This fix
was just plain wrong and this commit reverts it.
diff --git a/git-flow-feature b/git-flow-feature
index 8893598..b69cc73 100644
--- a/git-flow-feature
+++ b/git-flow-feature
@@ -180,7 +180,7 @@
parse_cmdline "$@"
# read arguments into global variables
- NAME=$(last_arg "$@")
+ NAME=$1
BRANCH=$PREFIX$NAME
}
diff --git a/git-flow-hotfix b/git-flow-hotfix
index 545b5e7..5660131 100644
--- a/git-flow-hotfix
+++ b/git-flow-hotfix
@@ -124,7 +124,7 @@
eval set -- "${FLAGS_ARGV}"
# read arguments into global variables
- VERSION=$(last_arg "$@")
+ VERSION=$1
BRANCH=$PREFIX$VERSION
}
diff --git a/git-flow-release b/git-flow-release
index aea6e42..05815bc 100644
--- a/git-flow-release
+++ b/git-flow-release
@@ -121,7 +121,7 @@
eval set -- "${FLAGS_ARGV}"
# read arguments into global variables
- VERSION=$(last_arg "$@")
+ VERSION=$1
BRANCH=$PREFIX$VERSION
}
diff --git a/gitflow-common b/gitflow-common
index 4255f99..c58cca0 100644
--- a/gitflow-common
+++ b/gitflow-common
@@ -44,14 +44,6 @@
warn() { echo "$@" >&2; }
die() { warn "$@"; exit 1; }
-# argument processing
-last_arg() {
- if [ $# -ne 0 ]; then
- shift $(expr $# - 1)
- echo "$1"
- fi
-}
-
# set logic
has() {
local item=$1; shift