X-Git-Url: https://git.phdru.name/?p=git-scripts.git;a=blobdiff_plain;f=fork;h=51883568272ae6cd3ff03149663e0dacf0217c6f;hp=2a537b483b87c5d4d0079fcf465918531fdbaa01;hb=99ebfdfab34769549340fb0cf2050f2f6d430b10;hpb=c0d1785b8a5564edcf3bcd38446ef6d327fd5153 diff --git a/fork b/fork index 2a537b4..5188356 100755 --- a/fork +++ b/fork @@ -1,13 +1,14 @@ #! /bin/sh -if [ -z "$2" ]; then - echo "Usage: $0 upstream origin" >&2 +if [ -z "$2" -o -n "$4" ]; then + echo "Usage: $0 upstream origin [local]" >&2 exit 1 fi upstream="$1" origin="$2" -local_repo="`basename \"$origin\" .git`" +local_repo="$3" +test -z "$local_repo" && local_repo="`basename \"$origin\" .git`" if [ -d "$local_repo"/.git ]; then cd "$local_repo"