author | Junio C Hamano <junkio@cox.net> | |
Wed, 27 Dec 2006 10:43:46 +0000 (02:43 -0800) | ||
committer | Junio 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>
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 | patch | | diff1 | | diff2 | | blob | history |
commit.c | patch | | diff1 | | diff2 | | blob | history |
commit.h | patch | | diff1 | | diff2 | | blob | history |
fetch-pack.c | patch | | diff1 | | diff2 | | blob | history |
git-clone.sh | patch | | diff1 | | diff2 | | blob | history |
git-fetch.sh | patch | | diff1 | | diff2 | | blob | history |
t/t5500-fetch-pack.sh | patch | | diff1 | | diff2 | | blob | history |
upload-pack.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc Makefile
index ea5d2cf7239645295c81ae078f8a4a3ce13debcb,52d4a3a86a214a99bd3cf32053539e18f36778a7..c21b91bfab2e8665be728593c64352137c857fd4
+++ b/Makefile
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
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
--- 1/git-clone.sh
--- 2/git-clone.sh
+++ b/git-clone.sh
}
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
--- 1/git-fetch.sh
--- 2/git-fetch.sh
+++ b/git-fetch.sh
case "$taglist" in
'') ;;
?*)
- fetch_main "$taglist" ;;
+ # do not deepen a shallow tree when following tags
+ shallow_depth=
+ fetch_main "$taglist" || exit ;;
esac
esac
diff --cc t/t5500-fetch-pack.sh
index fa108403033cb4329c3ad098b63250e724988a51,f7625a6f4634da4b78c90defdc0a302c8ea4e231..77c3c575d89ad5707ad8f6b22f62b58aef458104
+++ b/t/t5500-fetch-pack.sh
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