X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=git-publish-branch;h=4986c363d9c5d3f02d61c1714e560c0acba7088b;hb=deed66c863e13a1fb1b94d57c7b0d158d70cba46;hp=fb38886c16154a11cbd52297fd46602266a89412;hpb=ee12535d2368579f06ca52b9cadbe23ca0ea4b7f;p=git-utils.git diff --git a/git-publish-branch b/git-publish-branch index fb38886..4986c36 100755 --- a/git-publish-branch +++ b/git-publish-branch @@ -1,5 +1,5 @@ #!/bin/sh -# git-publish-branch [-d] [repository] +# git-publish-branch [-d] [branch] [repository] unset delete if [ "$1" = "-d" ]; then @@ -13,11 +13,11 @@ unset remote if [ $# -eq 1 ]; then branch=$1 elif [ $# -eq 2 ]; then - remote=$1 - branch=$2 + branch=$1 + remote=$2 elif [ $# -gt 2 ]; then - echo "Usage: $0 [] " >&2 - exit 127 + echo "Usage: $0 [branch] [repository]" >&2 + exit 1 fi if [ -z "$branch" ]; then @@ -49,14 +49,14 @@ if [ $delete ]; then fi else if [ -z "$local_ref" ]; then - echo "$0: no local branch $branch" >&2 - exit 127 + echo "no local branch $branch" >&2 + exit 1 elif [ -n "$remote_ref" ]; then - echo "$0: $remote already has branch $branch" >&2 - exit 127 + echo "$remote already has branch $branch" >&2 + exit 1 elif [ -n "$remote_config" ]; then - echo "$0: local branch $branch is already a tracking branch" >&2 - exit 127 + echo "local branch $branch is already a tracking branch" >&2 + exit 1 fi git push "$remote" "$branch:refs/heads/$branch"