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
+++ 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
+++ 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
@@@ -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
@@@ -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
  
@@@ -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