Code

Merge branch 'jc/fetch'
authorJunio C Hamano <junkio@cox.net>
Wed, 14 Mar 2007 08:40:19 +0000 (01:40 -0700)
committerJunio C Hamano <junkio@cox.net>
Wed, 14 Mar 2007 08:40:19 +0000 (01:40 -0700)
* 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

1  2 
.gitignore
Makefile
builtin.h
git-fetch.sh
git.c

diff --cc .gitignore
Simple merge
diff --cc Makefile
Simple merge
diff --cc builtin.h
Simple merge
diff --cc git-fetch.sh
index 5ae0d28cc09a0b3935262a542c9811b66eb5b85e,4a8d8d6ef73921ebd99ef68ffa097cd325453763..9d45dd266a8110a2d39fe29ffeb84aacb6053623
@@@ -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 fe2b74ab79619c425d7944c02a7f37c5e218bdef,2361b5fbbc4729c728159a7f2d79408a0ec1e8d6..dde4d07e8fbb830791417d422e4b9204373935e4
--- 1/git.c
--- 2/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 },