diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-06-27 14:37:41 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-06-27 14:37:41 -0700 |
commit | 0fb2c97c206958a13e8979187b7b3cc31d389126 (patch) | |
tree | 83687d7743812157c37fd644127ba47844f441f3 | |
parent | 11fbc0b1e1d5435f482af7bf391fd0d679955ba6 (diff) | |
parent | 71d5f938910120275484aac0b2e1c27cdf8b5cf3 (diff) | |
download | git-0fb2c97c206958a13e8979187b7b3cc31d389126.tar.gz git-0fb2c97c206958a13e8979187b7b3cc31d389126.tar.xz |
Merge branch 'mh/fetch-into-shallow' into maint
* mh/fetch-into-shallow:
t5500: add test for fetching with an unknown 'shallow'
upload-pack: ignore 'shallow' lines with unknown obj-ids
-rw-r--r-- | Documentation/technical/pack-protocol.txt | 3 | ||||
-rwxr-xr-x | t/t5500-fetch-pack.sh | 14 | ||||
-rw-r--r-- | upload-pack.c | 2 |
3 files changed, 16 insertions, 3 deletions
diff --git a/Documentation/technical/pack-protocol.txt b/Documentation/technical/pack-protocol.txt index f1a51edf4..b898e9798 100644 --- a/Documentation/technical/pack-protocol.txt +++ b/Documentation/technical/pack-protocol.txt @@ -228,8 +228,7 @@ obtained through ref discovery. The client MUST write all obj-ids which it only has shallow copies of (meaning that it does not have the parents of a commit) as 'shallow' lines so that the server is aware of the limitations of -the client's history. Clients MUST NOT mention an obj-id which -it does not know exists on the server. +the client's history. The client now sends the maximum commit history depth it wants for this transaction, which is the number of commits it wants from the diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index d57408569..6133d9ed1 100755 --- a/t/t5500-fetch-pack.sh +++ b/t/t5500-fetch-pack.sh @@ -373,6 +373,20 @@ test_expect_success 'clone shallow with packed refs' ' test_cmp count8.expected count8.actual ' +test_expect_success 'fetch in shallow repo unreachable shallow objects' ' + ( + git clone --bare --branch B --single-branch "file://$(pwd)/." no-reflog && + git clone --depth 1 "file://$(pwd)/no-reflog" shallow9 && + cd no-reflog && + git tag -d TAGB1 TAGB2 && + git update-ref refs/heads/B B~~ && + git gc --prune=now && + cd ../shallow9 && + git fetch origin && + git fsck --no-dangling + ) +' + test_expect_success 'setup tests for the --stdin parameter' ' for head in C D E F do diff --git a/upload-pack.c b/upload-pack.c index bfa6279cc..127e59a60 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -592,7 +592,7 @@ static void receive_needs(void) die("invalid shallow line: %s", line); object = parse_object(sha1); if (!object) - die("did not find object for %s", line); + continue; if (object->type != OBJ_COMMIT) die("invalid shallow object %s", sha1_to_hex(sha1)); if (!(object->flags & CLIENT_SHALLOW)) { |