aboutsummaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 8b9058971..3a13397e0 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -423,6 +423,7 @@ cmd_update()
cmd_init "--" "$@" || return
fi
+ cloned_modules=
module_list "$@" |
while read mode sha1 stage path
do
@@ -442,6 +443,7 @@ cmd_update()
if ! test -d "$path"/.git -o -f "$path"/.git
then
module_clone "$path" "$url" "$reference"|| exit
+ cloned_modules="$cloned_modules;$name"
subsha1=
else
subsha1=$(clear_local_git_env; cd "$path" &&
@@ -469,6 +471,13 @@ cmd_update()
die "Unable to fetch in submodule path '$path'"
fi
+ # Is this something we just cloned?
+ case ";$cloned_modules;" in
+ *";$name;"*)
+ # then there is no local change to integrate
+ update_module= ;;
+ esac
+
case "$update_module" in
rebase)
command="git rebase"