Merge branch 'master' into js/shallow
authorJunio C Hamano <junkio@cox.net>
Wed, 27 Dec 2006 10:43:46 +0000 (02:43 -0800)
committerJunio C Hamano <junkio@cox.net>
Wed, 27 Dec 2006 10:43:46 +0000 (02:43 -0800)
This is to adjust to:

  count-objects -v: show number of packs as well.

which will break a test in this series.

Signed-off-by: Junio C Hamano <junkio@cox.net>
1  2 
Makefile
commit.c
commit.h
fetch-pack.c
git-clone.sh
git-fetch.sh
t/t5500-fetch-pack.sh
upload-pack.c

diff --cc Makefile
index ea5d2cf7239645295c81ae078f8a4a3ce13debcb,52d4a3a86a214a99bd3cf32053539e18f36778a7..c21b91bfab2e8665be728593c64352137c857fd4
+++ b/Makefile
@@@ -260,7 -250,8 +250,7 @@@ LIB_OBJS = 
        revision.o pager.o tree-walk.o xdiff-interface.o \
        write_or_die.o trace.o list-objects.o grep.o \
        alloc.o merge-file.o path-list.o help.o unpack-trees.o $(DIFF_OBJS) \
-       color.o wt-status.o archive-zip.o archive-tar.o shallow.o
 -      color.o wt-status.o archive-zip.o archive-tar.o \
 -      utf8.o
++      color.o wt-status.o archive-zip.o archive-tar.o shallow.o utf8.o
  
  BUILTIN_OBJS = \
        builtin-add.o \
diff --cc commit.c
Simple merge
diff --cc commit.h
index e9e158f4e1c670635dda02766f67da3821374669,10eea9f26ff5db9df82245756c9c8bff0f6be3f6..936f8fce301672b5b78352a217403cc319ab3f07
+++ b/commit.h
@@@ -107,11 -107,5 +107,12 @@@ int read_graft_file(const char *graft_f
  
  extern struct commit_list *get_merge_bases(struct commit *rev1, struct commit *rev2, int cleanup);
  
 +extern int register_shallow(const unsigned char *sha1);
 +extern int unregister_shallow(const unsigned char *sha1);
 +extern int write_shallow_commits(int fd, int use_pack_protocol);
 +extern int is_repository_shallow();
 +extern struct commit_list *get_shallow_commits(struct object_array *heads,
 +              int depth, int shallow_flag, int not_shallow_flag);
 +
+ int in_merge_bases(struct commit *rev1, struct commit *rev2);
  #endif /* COMMIT_H */
diff --cc fetch-pack.c
Simple merge
diff --cc git-clone.sh
index 8c0a93ebd15399fad6f58fcf315709cb94fd6128,490f3e48db02d01cb480047c011aa7b670c431bc..f37eb9d105264294e1dd63beaeb192023a0ec8c6
@@@ -14,7 -14,7 +14,7 @@@ die() 
  }
  
  usage() {
-       die "Usage: $0 [--template=<template_directory>] [--use-immingled-remote] [--reference <reference-repo>] [--bare] [-l [-s]] [-q] [-u <upload-pack>] [--origin <name>] [--depth <n>] [-n] <repo> [<dir>]"
 -      die "Usage: $0 [--template=<template_directory>] [--reference <reference-repo>] [--bare] [-l [-s]] [-q] [-u <upload-pack>] [--origin <name>] [-n] <repo> [<dir>]"
++      die "Usage: $0 [--template=<template_directory>] [--reference <reference-repo>] [--bare] [-l [-s]] [-q] [-u <upload-pack>] [--origin <name>] [--depth <n>] [-n] <repo> [<dir>]"
  }
  
  get_repo_base() {
diff --cc git-fetch.sh
index f0645d97c91e1151354b737bb3259313dd07fed8,ffbd44f0e1ab841e6f6a38295860220b01bb26ea..5f316053fb9ad146546ed0718cc98b772c48b07f
@@@ -461,9 -451,7 +463,9 @@@ case "$no_tags$tags" i
        case "$taglist" in
        '') ;;
        ?*)
-               fetch_main "$taglist" ;;
 +              # do not deepen a shallow tree when following tags
 +              shallow_depth=
+               fetch_main "$taglist" || exit ;;
        esac
  esac
  
index fa108403033cb4329c3ad098b63250e724988a51,f7625a6f4634da4b78c90defdc0a302c8ea4e231..77c3c575d89ad5707ad8f6b22f62b58aef458104
@@@ -128,49 -128,4 +128,54 @@@ pull_to_client 2nd "B" $((64*3)
  
  pull_to_client 3rd "A" $((1*3)) # old fails
  
- test_expect_success "clone shallow object count (part 2)" \
-       "test -z \"$(grep -v in-pack count.shallow | sed "s/^.*: 0//")\""
 +test_expect_success "clone shallow" "git-clone --depth 2 . shallow"
 +
 +(cd shallow; git-count-objects -v) > count.shallow
 +
 +test_expect_success "clone shallow object count" \
 +      "test \"in-pack: 18\" = \"$(grep in-pack count.shallow)\""
 +
++count_output () {
++      sed -e '/^in-pack:/d' -e '/^packs:/d' -e '/: 0$/d' "$1"
++}
++
++test_expect_success "clone shallow object count (part 2)" '
++      test -z "$(count_output count.shallow)"
++'
 +
 +test_expect_success "fsck in shallow repo" \
 +      "(cd shallow; git-fsck-objects --full)"
 +
 +#test_done; exit
 +
 +add B66 $B65
 +add B67 $B66
 +
 +test_expect_success "pull in shallow repo" \
 +      "(cd shallow; git pull .. B)"
 +
 +(cd shallow; git-count-objects -v) > count.shallow
 +test_expect_success "clone shallow object count" \
 +      "test \"count: 6\" = \"$(grep count count.shallow)\""
 +
 +add B68 $B67
 +add B69 $B68
 +
 +test_expect_success "deepening pull in shallow repo" \
 +      "(cd shallow; git pull --depth 4 .. B)"
 +
 +(cd shallow; git-count-objects -v) > count.shallow
 +test_expect_success "clone shallow object count" \
 +      "test \"count: 12\" = \"$(grep count count.shallow)\""
 +
 +test_expect_success "deepening fetch in shallow repo" \
 +      "(cd shallow; git fetch --depth 4 .. A:A)"
 +
 +(cd shallow; git-count-objects -v) > count.shallow
 +test_expect_success "clone shallow object count" \
 +      "test \"count: 18\" = \"$(grep count count.shallow)\""
 +
 +test_expect_failure "pull in shallow repo with missing merge base" \
 +      "(cd shallow; git pull --depth 4 .. A)"
 +
  test_done
diff --cc upload-pack.c
Simple merge