From: Junio C Hamano Date: Wed, 14 Mar 2007 08:40:19 +0000 (-0700) Subject: Merge branch 'jc/fetch' X-Git-Tag: v1.5.1-rc1~30 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c1f5086e23e97cdb8c913c10ff273e6cff913d52;p=git.git Merge branch 'jc/fetch' * jc/fetch: .gitignore: add git-fetch--tool builtin-fetch--tool: fix reflog notes. git-fetch: retire update-local-ref which is not used anymore. builtin-fetch--tool: make sure not to overstep ls-remote-result buffer. fetch--tool: fix uninitialized buffer when reading from stdin builtin-fetch--tool: adjust to updated sha1_object_info(). git-fetch--tool takes flags before the subcommand. Use stdin reflist passing in git-fetch.sh Use stdin reflist passing in parse-remote Allow fetch--tool to read from stdin git-fetch: rewrite expand_ref_wildcard in C git-fetch: rewrite another shell loop in C git-fetch: move more code into C. git-fetch--tool: start rewriting parts of git-fetch in C. git-fetch: split fetch_main into fetch_dumb and fetch_native --- c1f5086e23e97cdb8c913c10ff273e6cff913d52 diff --cc git-fetch.sh index 5ae0d28cc,4a8d8d6ef..9d45dd266 --- a/git-fetch.sh +++ b/git-fetch.sh @@@ -279,7 -155,30 +157,38 @@@ the fi fi - fetch_main () { + fetch_native () { + + eval=$(echo "$1" | git-fetch--tool parse-reflist "-") + eval "$eval" + + ( : subshell because we muck with IFS + IFS=" $LF" + ( - git-fetch-pack --thin $exec $keep $shallow_depth "$remote" $rref || ++ if test -f "$remote" ; then ++ test -n "$shallow_depth" && ++ die "shallow clone with bundle is not supported" ++ git-bundle unbundle "$remote" $rref || ++ echo failed "$remote" ++ else ++ git-fetch-pack --thin $exec $keep $shallow_depth $no_progress \ ++ "$remote" $rref || + echo failed "$remote" ++ fi + ) | + ( + flags= + test -n "$verbose" && flags="$flags -v" + test -n "$force" && flags="$flags -f" + GIT_REFLOG_ACTION="$GIT_REFLOG_ACTION" \ + git-fetch--tool $flags native-store \ + "$remote" "$remote_nick" "$refs" + ) + ) || exit + + } + + fetch_dumb () { reflist="$1" refs= rref= diff --cc git.c index fe2b74ab7,2361b5fbb..dde4d07e8 --- a/git.c +++ b/git.c @@@ -239,10 -237,11 +239,11 @@@ static void handle_internal_command(in { "config", cmd_config }, { "count-objects", cmd_count_objects, RUN_SETUP }, { "describe", cmd_describe, RUN_SETUP }, - { "diff", cmd_diff, RUN_SETUP | USE_PAGER }, - { "diff-files", cmd_diff_files, RUN_SETUP }, + { "diff", cmd_diff, USE_PAGER }, + { "diff-files", cmd_diff_files }, { "diff-index", cmd_diff_index, RUN_SETUP }, { "diff-tree", cmd_diff_tree, RUN_SETUP }, + { "fetch--tool", cmd_fetch__tool, RUN_SETUP }, { "fmt-merge-msg", cmd_fmt_merge_msg, RUN_SETUP }, { "for-each-ref", cmd_for_each_ref, RUN_SETUP }, { "format-patch", cmd_format_patch, RUN_SETUP },