X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=git-submodule.sh;h=3a13397e057edf88d2c810490ec3d7d755be2009;hb=7d6cb10b84d9931aacf1914db192cbeaaa88443d;hp=8b9058971767dbb4d94e996876f6ba7ed178ddd6;hpb=b20e9b0b521a416b00a81d6c4788dfd2df25efc0;p=thirdparty%2Fgit.git diff --git a/git-submodule.sh b/git-submodule.sh index 8b90589717..3a13397e05 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"