threads / patch / 31641

patchsubmodule: configure submodule.<name>.path on add and init

Subject: [PATCH] submodule: configure submodule.<name>.path on add and init

## tl;dr

One message between Sep 24, 2012 and Sep 24, 2012. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Orgad Shaneh· Sep 24, 2012, 19:32 UTC · lore
In order to read diff options for a submodule, its path must be configured
Signed-off-by: Orgad Shaneh <orgads@gmail.com>
---
 git-submodule.sh |    2 ++
 1 file changed, 2 insertions(+)
Show changes to git-submodule.sh +2 −0
diff --git a/git-submodule.sh b/git-submodule.sh
index 3e2045e..af9c003 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -359,6 +359,7 @@ Use -f if you really want to add it." >&2
 			esac
 		) || die "$(eval_gettext "Unable to checkout submodule '\$sm_path'")"
 	fi
+	git config submodule."$sm_path".path "$sm_path"
 	git config submodule."$sm_path".url "$realrepo"
 
 	git add $force "$sm_path" ||
@@ -476,6 +477,7 @@ cmd_init()
 				url=$(resolve_relative_url "$url") || exit
 				;;
 			esac
+			git config submodule."$name".path "$name" &&
 			git config submodule."$name".url "$url" ||
 			die "$(eval_gettext "Failed to register url for submodule path '\$sm_path'")"
 
-- 
1.7.10.4

← back to recent threads