Re: [PATCH] git-submodule: remove unnecessary exits when calling resolve_relative_url
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Sep 25, 2008, 12:19 UTC
- Message-ID
- <48DB81DE.6070600@viscovery.net>
- In-Reply-To
- <17c3c33dd7aa6803d7ac046f3e4dc0d5bb4c7234.1222341013.git.davvid@gmail.com>
David Aguilar schrieb:
> resolve_relative_url calls die() when no remote url exists so these calls to > exit can be removed.
...
Show 7 quoted lines
> @@ -155,7 +155,7 @@ cmd_add() > case "$repo" in > ./*|../*) > # dereference source url relative to parent's url > - realrepo=$(resolve_relative_url "$repo") || exit > + realrepo=$(resolve_relative_url "$repo") > ;;
Did you test it? The command inside $(...) is run in its own sub-process, therefore, the die() does not exit the caller, just the sub-process, and the || exit *is* required.
BTW, I think that || exit is sufficient; you don't need to add another error message - the one that resolve_relative_url() prints is sufficient.
-- Hannes