X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=git-submodule.sh;h=afcb4c09481c936b21e55b2ebb3802343a9a7c9e;hb=341f8a6476d1d25c3906696489d87fc381739b59;hp=aaa1809d243c6671a9c6fc959d96bd366a65efec;hpb=232378479ee6c66206d47a9be175e3a39682aea6;p=thirdparty%2Fgit.git diff --git a/git-submodule.sh b/git-submodule.sh index aaa1809d24..afcb4c0948 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -241,13 +241,15 @@ cmd_add() die "$(eval_gettext "'\$sm_path' does not have a commit checked out")" fi - if test -z "$force" && - ! git add --dry-run --ignore-missing --no-warn-embedded-repo "$sm_path" > /dev/null 2>&1 + if test -z "$force" then - eval_gettextln "The following path is ignored by one of your .gitignore files: -\$sm_path -Use -f if you really want to add it." >&2 - exit 1 + dryerr=$(git add --dry-run --ignore-missing --no-warn-embedded-repo "$sm_path" 2>&1 >/dev/null) + res=$? + if test $res -ne 0 + then + echo >&2 "$dryerr" + exit $res + fi fi if test -n "$custom_name"