Merge branch 'sb/submodule-add-force'
"git submodule add" used to be confused and refused to add a locally created repository; users can now use "--force" option to add them. * sb/submodule-add-force: submodule add: extend force flag to add existing repos
This commit is contained in:
@ -204,8 +204,14 @@ cmd_add()
|
||||
tstart
|
||||
s|/*$||
|
||||
')
|
||||
git ls-files --error-unmatch "$sm_path" > /dev/null 2>&1 &&
|
||||
die "$(eval_gettext "'\$sm_path' already exists in the index")"
|
||||
if test -z "$force"
|
||||
then
|
||||
git ls-files --error-unmatch "$sm_path" > /dev/null 2>&1 &&
|
||||
die "$(eval_gettext "'\$sm_path' already exists in the index")"
|
||||
else
|
||||
git ls-files -s "$sm_path" | sane_grep -v "^160000" > /dev/null 2>&1 &&
|
||||
die "$(eval_gettext "'\$sm_path' already exists in the index and is not a submodule")"
|
||||
fi
|
||||
|
||||
if test -z "$force" && ! git add --dry-run --ignore-missing "$sm_path" > /dev/null 2>&1
|
||||
then
|
||||
|
||||
Reference in New Issue
Block a user