threads / patch / 20421

patchMake 'submodule update' honor the 'update' setting in .gitmodules.

Subject: [PATCH] Make 'submodule update' honor the 'update' setting in .gitmodules.

## tl;dr

One message between Aug 6, 2009 and Aug 6, 2009. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Mikhail Glushenkov· Aug 6, 2009, 03:36 UTC · lore

Make the 'submodule update' command use the 'submodule.$path.update' setting in .gitmodules unless this setting is overridden in '.git/config' or with --rebase/--merge options.

Signed-off-by: Mikhail Glushenkov <the.dead.shall.rise@gmail.com>
---
 git-submodule.sh |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
Show changes to git-submodule.sh +9 −0
diff --git a/git-submodule.sh b/git-submodule.sh
index ebed711..636023a 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -372,6 +372,15 @@ cmd_update()
 		name=$(module_name "$path") || exit
 		url=$(git config submodule."$name".url)
 		update_module=$(git config submodule."$name".update)
+
+		if test -z "$update_module"
+		then
+		    update_module="$(git config -f .gitmodules submodule."$name".update)"
+		    test -z "$update_module" ||
+		    git config submodule."$name".update "$update_module" ||
+		    die "Failed to register update mode for submodule path '$path'"
+		fi
+
 		if test -z "$url"
 		then
 			# Only mention uninitialized submodules when its
-- 
1.6.4

← back to recent threads