Merge branch 'jk/bisect-show-tree'
[gitweb.git] / git-submodule.sh
index 7fe8a511b37a9705249132afedb57032fb65e86c..b39ac106ec33112b1dbd2bc5cad5767ce73bdc44 100755 (executable)
@@ -9,7 +9,7 @@ USAGE="[--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <re
    or: $dashless [--quiet] status [--cached] [--recursive] [--] [<path>...]
    or: $dashless [--quiet] init [--] [<path>...]
    or: $dashless [--quiet] deinit [-f|--force] (--all| [--] <path>...)
-   or: $dashless [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--reference <repository>] [--recursive] [--] [<path>...]
+   or: $dashless [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--checkout|--merge|--rebase] [--[no-]recommend-shallow] [--reference <repository>] [--recursive] [--] [<path>...]
    or: $dashless [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
    or: $dashless [--quiet] foreach [--recursive] <command>
    or: $dashless [--quiet] sync [--recursive] [--] [<path>...]"
@@ -530,6 +530,12 @@ cmd_update()
                --checkout)
                        update="checkout"
                        ;;
+               --recommend-shallow)
+                       recommend_shallow="--recommend-shallow"
+                       ;;
+               --no-recommend-shallow)
+                       recommend_shallow="--no-recommend-shallow"
+                       ;;
                --depth)
                        case "$2" in '') usage ;; esac
                        depth="--depth=$2"
@@ -572,6 +578,7 @@ cmd_update()
                ${update:+--update "$update"} \
                ${reference:+--reference "$reference"} \
                ${depth:+--depth "$depth"} \
+               ${recommend_shallow:+"$recommend_shallow"} \
                ${jobs:+$jobs} \
                "$@" || echo "#unmatched"
        } | {
@@ -611,7 +618,7 @@ cmd_update()
                        if test -z "$nofetch"
                        then
                                # Fetch remote before determining tracking $sha1
-                               (sanitize_submodule_env; cd "$sm_path" && git-fetch) ||
+                               fetch_in_submodule "$sm_path" ||
                                die "$(eval_gettext "Unable to fetch in submodule path '\$sm_path'")"
                        fi
                        remote_name=$(sanitize_submodule_env; cd "$sm_path" && get_default_remote)