From b63f5a3ab3657edc85714f4e9b6688dff77a4877 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Thu, 2 Jun 2016 19:03:18 +0200 Subject: bin: git-fork now follows git conventions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of having /, it is now specified as two separate arguments. This fits better into how git handles this stuff in other subcommands. Signed-off-by: Miquel Sabaté Solà --- bin/git-fork | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'bin') diff --git a/bin/git-fork b/bin/git-fork index a03b7a9..27933f4 100755 --- a/bin/git-fork +++ b/bin/git-fork @@ -26,7 +26,7 @@ set -e # branch. You can change the remote and the branch to be picked like this: # # $ git fork branch -# $ git fork remote/branch +# $ git fork remote branch # # Finally, if the given remote does not exist, the user will be prompted to # provide the URL to the remote, so it can be created. @@ -36,20 +36,11 @@ set -e branch='master' upstream='upstream' -# You can modify the defaults by specifying either "branch" or "remote/branch". -if [ ! -z $1 ]; then - ifs=$IFS - IFS='/' - - read -ra results <<< "$1" - if [ ${#results[@]} -eq 2 ]; then - upstream=${results[0]} - branch=${results[1]} - else - branch=${results[0]} - fi - - IFS=$ifs +if [ ! -z "$1" ]; then + upstream="$1" +fi +if [ ! -z "$2" ]; then + branch="$2" fi # Check whether the given upstream remote really exists. If it doesn't it will -- cgit v1.2.3