git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-submodule - Fix errors regarding resolve_relative_url

From
Mark Levedahl <mlevedahl@gmail.com>
Date
Jun 14, 2008, 19:36 UTC
Message-ID
<1213472189-252-1-git-send-email-mlevedahl@gmail.com>
In-Reply-To
<7vd4mjhnwk.fsf@gitster.siamese.dyndns.org>

git-submodule was invoking "die" from within resolve-relative-url, but the error return was ignored by the callers. Fix this.

While we're at it, clean up the quoting on invocation of resolve_relative_url as it was wrong.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
---
 git-submodule.sh |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index 4bd2b8e..9c890d3 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -178,7 +178,8 @@ cmd_add()
 		case "$repo" in
 		./*|../*)
 			# dereference source url relative to parent's url
-			realrepo="$(resolve_relative_url $repo)" ;;
+			realrepo=$(resolve_relative_url "$repo") || exit
+			;;
 		*)
 			# Turn the source into an absolute path if
 			# it is local
@@ -246,7 +247,7 @@ cmd_init()
 		# Possibly a url relative to parent
 		case "$url" in
 		./*|../*)
-			url="$(resolve_relative_url "$url")"
+			url=$(resolve_relative_url "$url") || exit
 			;;
 		esac
 
-- 
1.5.6.rc2.65.gcb6b9
Previous: Junio C Hamano
Message 3 of 3 in “git-submodule - Fix errors regarding resolve_relative_url”
  1. git-submodule - Fix errors regarding resolve_relative_urlMark Levedahl, Jun 14, 2008
  2. Junio C HamanoJun 14, 2008
  3. git-submodule - Fix errors regarding resolve_relative_urlMark Levedahl, Jun 14, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.