Skip to content
This repository was archived by the owner on Jun 19, 2023. It is now read-only.

Commit cf3885e

Browse files
committed
Change git flow {bugfix,feature,hotfix} rename argument order to [<old_name>] <new_name>, following git conventions (like git branch --move [<oldbranch>] <newbranch>)
1 parent d6e43fd commit cf3885e

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

git-flow-bugfix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ r,[no]remote Delete remote branch
832832

833833
cmd_rename() {
834834
OPTIONS_SPEC="\
835-
git flow bugfix rename <new_name> [<old_name>]
835+
git flow bugfix rename [<old_name>] <new_name>
836836
837837
Rename a given bugfix branch
838838
--

git-flow-feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ r,[no]remote Delete remote branch
833833

834834
cmd_rename() {
835835
OPTIONS_SPEC="\
836-
git flow feature rename <new_name> [<old_name>]
836+
git flow feature rename [<old_name>] <new_name>
837837
838838
Rename a given feature branch
839839
--

git-flow-hotfix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ r,[no]remote Delete remote branch
735735

736736
cmd_rename() {
737737
OPTIONS_SPEC="\
738-
git flow hotfix rename <new_name> [<old_name>]
738+
git flow hotfix rename [<old_name>] <new_name>
739739
740740
Rename a given hotfix branch
741741
--

gitflow-common

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -609,15 +609,17 @@ gitflow_rename_branch() {
609609
# read arguments into global variables
610610
if [ -z $1 ]; then
611611
NEW_NAME=''
612-
else
613-
NEW_NAME=$1
614-
fi
615-
616-
if [ -z $2 ]; then
617612
NAME=''
618613
else
619-
NAME=$2
614+
if [ -z $2 ]; then
615+
NAME=''
616+
NEW_NAME=$1
617+
else
618+
NAME=$1
619+
NEW_NAME=$2
620+
fi
620621
fi
622+
621623
BRANCH=${PREFIX}${NAME}
622624
NEW_BRANCH=${PREFIX}${NEW_NAME}
623625

0 commit comments

Comments
 (0)