Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge commit 'britt/master'

  • Loading branch information...
commit ee2269e5e90c028ebddb087d05c9d3fb509e06cb 2 parents 8c9d35a + 33df706
Robey Pointer authored
Showing with 11 additions and 11 deletions.
  1. +11 −11 tig
View
22 tig
@@ -22,18 +22,18 @@ case "$1" in
fork)
# git fork <branch> [<original-branch>]
- # (checkout -b)
shift
- if [ $# -eq 1 ]; then
- # git fork <branch>
- if check_remote_branch "$1"; then
- # "git fork origin/somebranch" -> make local "somebranch"
- git checkout -b "$remote_branch" "$1"
- else
- git checkout -b "$1"
- fi
- else
- git checkout -b "$@"
+
+ # "git fork origin/somebranch" -> make local "somebranch"
+ if [ $# -eq 1 ] && check_remote_branch "$1"; then
+ all_args="$remote_branch $1"
+ fi
+
+ git checkout -b $all_args
+
+ # If the branch already exists, just switch to it.
+ if [ $? -eq 128 ]; then
+ git checkout $all_args
fi
;;
Please sign in to comment.
Something went wrong with that request. Please try again.