diff options
| author | Miquel Sabaté Solà <msabate@suse.com> | 2016-06-02 19:03:18 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <msabate@suse.com> | 2016-06-02 19:05:25 +0200 |
| commit | b63f5a3ab3657edc85714f4e9b6688dff77a4877 (patch) | |
| tree | e8bcc2c48a2f0daab9bf5c3a9a8f114c093b2a9b | |
| parent | a8feaa324fa1a40ce0bcdf0bffe792d7a7f6409f (diff) | |
| download | dotfiles-b63f5a3ab3657edc85714f4e9b6688dff77a4877.tar.gz dotfiles-b63f5a3ab3657edc85714f4e9b6688dff77a4877.zip | |
bin: git-fork now follows git conventions
Instead of having <upstream>/<branch>, 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à <msabate@suse.com>
| -rwxr-xr-x | bin/git-fork | 21 |
1 files changed, 6 insertions, 15 deletions
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 |
