зеркало из https://github.com/microsoft/git.git
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
This commit is contained in:
Коммит
0fb2c97c20
|
@ -228,8 +228,7 @@ obtained through ref discovery.
|
||||||
The client MUST write all obj-ids which it only has shallow copies
|
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
|
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
|
'shallow' lines so that the server is aware of the limitations of
|
||||||
the client's history. Clients MUST NOT mention an obj-id which
|
the client's history.
|
||||||
it does not know exists on the server.
|
|
||||||
|
|
||||||
The client now sends the maximum commit history depth it wants for
|
The client now sends the maximum commit history depth it wants for
|
||||||
this transaction, which is the number of commits it wants from the
|
this transaction, which is the number of commits it wants from the
|
||||||
|
|
|
@ -373,6 +373,20 @@ test_expect_success 'clone shallow with packed refs' '
|
||||||
test_cmp count8.expected count8.actual
|
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' '
|
test_expect_success 'setup tests for the --stdin parameter' '
|
||||||
for head in C D E F
|
for head in C D E F
|
||||||
do
|
do
|
||||||
|
|
|
@ -592,7 +592,7 @@ static void receive_needs(void)
|
||||||
die("invalid shallow line: %s", line);
|
die("invalid shallow line: %s", line);
|
||||||
object = parse_object(sha1);
|
object = parse_object(sha1);
|
||||||
if (!object)
|
if (!object)
|
||||||
die("did not find object for %s", line);
|
continue;
|
||||||
if (object->type != OBJ_COMMIT)
|
if (object->type != OBJ_COMMIT)
|
||||||
die("invalid shallow object %s", sha1_to_hex(sha1));
|
die("invalid shallow object %s", sha1_to_hex(sha1));
|
||||||
if (!(object->flags & CLIENT_SHALLOW)) {
|
if (!(object->flags & CLIENT_SHALLOW)) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче