X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-submodule.sh;h=d189a24c71c44806a9c1381e2a8e5993269e568a;hb=83933c9832af91a71337e429a6251f1a3b6d6f60;hp=bf110e9cb77a0e9930c427408e18d323db2c8916;hpb=a6f3f178bd7ce48f7fe4262a1e5efb3ae6a98a4d;p=git.git diff --git a/git-submodule.sh b/git-submodule.sh index bf110e9cb..d189a24c7 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -495,7 +495,7 @@ cmd_update() # Run fetch only if $sha1 isn't present or it # is not reachable from a ref. (clear_local_git_env; cd "$path" && - ((rev=$(git rev-list -n 1 $sha1 --not --all 2>/dev/null) && + ( (rev=$(git rev-list -n 1 $sha1 --not --all 2>/dev/null) && test -z "$rev") || git-fetch)) || die "Unable to fetch in submodule path '$path'" fi