File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -228,8 +228,7 @@ obtained through ref discovery.
228228The client MUST write all obj-ids which it only has shallow copies
229229of (meaning that it does not have the parents of a commit) as
230230'shallow' lines so that the server is aware of the limitations of
231- the client's history. Clients MUST NOT mention an obj-id which
232- it does not know exists on the server.
231+ the client's history.
233232
234233The client now sends the maximum commit history depth it wants for
235234this transaction, which is the number of commits it wants from the
Original file line number Diff line number Diff line change @@ -373,6 +373,20 @@ test_expect_success 'clone shallow with packed refs' '
373373 test_cmp count8.expected count8.actual
374374'
375375
376+ test_expect_success ' fetch in shallow repo unreachable shallow objects' '
377+ (
378+ git clone --bare --branch B --single-branch "file://$(pwd)/." no-reflog &&
379+ git clone --depth 1 "file://$(pwd)/no-reflog" shallow9 &&
380+ cd no-reflog &&
381+ git tag -d TAGB1 TAGB2 &&
382+ git update-ref refs/heads/B B~~ &&
383+ git gc --prune=now &&
384+ cd ../shallow9 &&
385+ git fetch origin &&
386+ git fsck --no-dangling
387+ )
388+ '
389+
376390test_expect_success ' setup tests for the --stdin parameter' '
377391 for head in C D E F
378392 do
Original file line number Diff line number Diff line change @@ -592,7 +592,7 @@ static void receive_needs(void)
592592 die ("invalid shallow line: %s" , line );
593593 object = parse_object (sha1 );
594594 if (!object )
595- die ( "did not find object for %s" , line ) ;
595+ continue ;
596596 if (object -> type != OBJ_COMMIT )
597597 die ("invalid shallow object %s" , sha1_to_hex (sha1 ));
598598 if (!(object -> flags & CLIENT_SHALLOW )) {
You can’t perform that action at this time.
0 commit comments