Merge branch 'jl/submodule-add-noname'

* jl/submodule-add-noname:
  git submodule add: make the <path> parameter optional
This commit is contained in:
Junio C Hamano
2009-11-20 23:46:07 -08:00
3 changed files with 28 additions and 3 deletions

View File

@ -5,7 +5,7 @@
# Copyright (c) 2007 Lars Hjemli
dashless=$(basename "$0" | sed -e 's/-/ /')
USAGE="[--quiet] add [-b branch] [--reference <repository>] [--] <repository> <path>
USAGE="[--quiet] add [-b branch] [--reference <repository>] [--] <repository> [<path>]
or: $dashless [--quiet] status [--cached] [--recursive] [--] [<path>...]
or: $dashless [--quiet] init [--] [<path>...]
or: $dashless [--quiet] update [--init] [-N|--no-fetch] [--rebase] [--reference <repository>] [--merge] [--recursive] [--] [<path>...]
@ -160,6 +160,11 @@ cmd_add()
repo=$1
path=$2
if test -z "$path"; then
path=$(echo "$repo" |
sed -e 's|/$||' -e 's|:*/*\.git$||' -e 's|.*[/:]||g')
fi
if test -z "$repo" -o -z "$path"; then
usage
fi