diff options
| author | Junio C Hamano <gitster@pobox.com> | 2011-04-15 13:25:50 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2011-04-15 13:27:04 -0700 |
| commit | ed44fd045a8a4bcf7f30a47e4fc6aba761faaf78 (patch) | |
| tree | ccc8afe7eb85ec89347047f8e3fb5ff7f4c2f6a6 /git-submodule.sh | |
| parent | e0d48279d5a96bc02edac72c1d28fc38aed37c15 (diff) | |
| parent | 4d8b32a2e1758236c4c1b714f179892e3bce982c (diff) | |
| download | git-ed44fd045a8a4bcf7f30a47e4fc6aba761faaf78.tar.xz | |
Merge v1.7.5-rc2 into jn/format-patch-doc
This is to sync with the recent updates in Documentation/SubmittingPatches
and Documentation/format-patch.txt
Diffstat (limited to 'git-submodule.sh')
| -rwxr-xr-x | git-submodule.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/git-submodule.sh b/git-submodule.sh index 7f6b3cf207..b010a67309 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -488,8 +488,11 @@ cmd_update() if test -z "$nofetch" then + # Run fetch only if $sha1 isn't present or it + # is not reachable from a ref. (clear_local_git_env; cd "$path" && - git-fetch) || + ((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 |
