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

[PATCH] git-submodule: remove unnecessary exits when calling resolve_relative_url

From
David Aguilar <davvid@gmail.com>
Date
Sep 25, 2008, 11:21 UTC
Message-ID
<17c3c33dd7aa6803d7ac046f3e4dc0d5bb4c7234.1222341013.git.davvid@gmail.com>
In-Reply-To
<200809221808.31730.johan@herland.net>

resolve_relative_url calls die() when no remote url exists so these calls to exit can be removed.

Signed-off-by: David Aguilar <davvid@gmail.com>
---

This applies on top of the first "Fix submodule sync with relative submodule URLs" patch by Johan Herland. Shawn's comments made me realize that the resolve_relative_url callers could be cleaned up.

 git-submodule.sh |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index 92be0fe..533d1cc 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -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")
 		;;
 	*:*|/*)
 		# absolute url
@@ -184,7 +184,7 @@ cmd_add()
 
 		case "$repo" in
 		./*|../*)
-			url=$(resolve_relative_url "$repo") || exit
+			url=$(resolve_relative_url "$repo")
 		    ;;
 		*)
 			url="$repo"
@@ -270,7 +270,7 @@ cmd_init()
 		# Possibly a url relative to parent
 		case "$url" in
 		./*|../*)
-			url=$(resolve_relative_url "$url") || exit
+			url=$(resolve_relative_url "$url")
 			;;
 		esac
 
@@ -638,7 +638,7 @@ cmd_sync()
 		# Possibly a url relative to parent
 		case "$url" in
 		./*|../*)
-			url=$(resolve_relative_url "$url") || exit
+			url=$(resolve_relative_url "$url")
 			;;
 		esac
 
-- 
1.6.0.2.307.gc4275
Previous: David AguilarNext: Johannes Sixt
Message 7 of 10 in “Fix submodule sync with relative submodule URLs”
  1. Fix submodule sync with relative submodule URLsJohan Herland, Sep 22, 2008
  2. David AguilarSep 24, 2008
  3. Fix submodule sync with relative submodule URLsJohan Herland, Sep 24, 2008
  4. Shawn O. PearceSep 24, 2008
  5. Johan HerlandSep 24, 2008
  6. David AguilarSep 25, 2008
  7. git-submodule: remove unnecessary exits when calling resolve_relative_urlDavid Aguilar, Sep 25, 2008
  8. Johannes SixtSep 25, 2008
  9. Shawn O. PearceSep 25, 2008
  10. Johan HerlandSep 25, 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.