X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=scripts%2Fgitcreate;h=ecd9f0ffa8e6966a66901a0f25e87a1a9377d376;hb=6a2a887a8152432fe2069442a6bcdda881dcbdc6;hp=4dadacd270f938328c1215e759d6b2543ee8cb36;hpb=9f2bf73914fe26e0386cda1f6a5c28339ad73d9c;p=repo_shell.git diff --git a/scripts/gitcreate b/scripts/gitcreate index 4dadacd..ecd9f0f 100755 --- a/scripts/gitcreate +++ b/scripts/gitcreate @@ -28,12 +28,13 @@ if [ "$1" = "-y" ]; then shift fi -if [ $# -ne 1 ]; then - echo "usage: $0 " >&2 +if [ $# -lt 1 -o $# -gt 2 ]; then + echo "usage: $0 [\"Short description\"]" >&2 exit 1 fi repopath=$1 +repodesc=$2 if [ -e $git_root/$repopath ]; then echo "$0: repository $repopath already exists" >&2 @@ -64,6 +65,11 @@ umask 027 git --git-dir "$git_root/$repopath" init --bare [ $? -ne 0 ] && exit 1 +# Update the description +if [ -n "$2" ]; then + echo $2 > $git_root/$repopath/description +fi + # Create symbolic links to any hook scripts in $githookspath hooks="pre-receive post-receive update post-update" backdir=$(echo "$repopath/hooks" | sed -e 's|[^/]*|..|g')