Thread (3 messages) flat view 3 messages, 1 author, 2016-06-15
DORMANTno replies

Revision v1 of 2 in this series.

Revisions (2)
  1. rfc [diff vs current]
  2. v1 current

[PATCH 1/2] submodule: move update configuration variable further up

From: Heiko Voigt <hidden>
Date: 2016-06-15 22:51:47
Subsystem: the rest · Maintainer: Linus Torvalds

Lets always initialize the 'update_module' variable with the final
value. This way we allow code which wants to check this configuration
early to do so right in the beginning of cmd_update().

Signed-off-by: Heiko Voigt <redacted>
---
 git-submodule.sh |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index f46862f..e544dbc 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -461,7 +461,13 @@ cmd_update()
 		fi
 		name=$(module_name "$path") || exit
 		url=$(git config submodule."$name".url)
-		update_module=$(git config submodule."$name".update)
+		if ! test -z "$update"
+		then
+			update_module=$update
+		else
+			update_module=$(git config submodule."$name".update)
+		fi
+
 		if test -z "$url"
 		then
 			# Only mention uninitialized submodules when its
@@ -483,11 +489,6 @@ Maybe you want to use 'update --init'?")"
 			die "$(eval_gettext "Unable to find current revision in submodule path '\$path'")"
 		fi
 
-		if ! test -z "$update"
-		then
-			update_module=$update
-		fi
-
 		if test "$subsha1" != "$sha1"
 		then
 			subforce=$force
-- 
1.7.6.435.g741d34
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help