#! /bin/sh
-if [ -z "$1" ]; then
- echo "Usage: $0 origin" >&2
+if [ -z "$1" -o -n "$3" ]; then
+ echo "Usage: $0 origin [local]" >&2
exit 1
fi
origin="$1"
-local_repo="`basename \"$origin\" .git`"
+local_repo="$2"
+test -z "$local_repo" && local_repo="`basename \"$origin\" .git`"
if [ -d "$local_repo"/.git ]; then
cd "$local_repo"
#! /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"