File tree Expand file tree Collapse file tree 2 files changed +26
-6
lines changed Expand file tree Collapse file tree 2 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -512,12 +512,6 @@ static int batch_objects(struct batch_options *opt)
512
512
if (opt -> cmdmode )
513
513
data .split_on_whitespace = 1 ;
514
514
515
- if (opt -> all_objects ) {
516
- struct object_info empty = OBJECT_INFO_INIT ;
517
- if (!memcmp (& data .info , & empty , sizeof (empty )))
518
- data .skip_object_info = 1 ;
519
- }
520
-
521
515
/*
522
516
* If we are printing out the object, then always fill in the type,
523
517
* since we will want to decide whether or not to stream.
@@ -527,6 +521,10 @@ static int batch_objects(struct batch_options *opt)
527
521
528
522
if (opt -> all_objects ) {
529
523
struct object_cb_data cb ;
524
+ struct object_info empty = OBJECT_INFO_INIT ;
525
+
526
+ if (!memcmp (& data .info , & empty , sizeof (empty )))
527
+ data .skip_object_info = 1 ;
530
528
531
529
if (has_promisor_remote ())
532
530
warning ("This repository uses promisor remotes. Some objects may not be loaded." );
Original file line number Diff line number Diff line change @@ -586,4 +586,26 @@ test_expect_success 'cat-file --unordered works' '
586
586
test_cmp expect actual
587
587
'
588
588
589
+ test_expect_success ' set up object list for --batch-all-objects tests' '
590
+ git -C all-two cat-file --batch-all-objects --batch-check="%(objectname)" >objects
591
+ '
592
+
593
+ test_expect_success ' cat-file --batch="%(objectname)" with --batch-all-objects will work' '
594
+ git -C all-two cat-file --batch="%(objectname)" <objects >expect &&
595
+ git -C all-two cat-file --batch-all-objects --batch="%(objectname)" >actual &&
596
+ cmp expect actual
597
+ '
598
+
599
+ test_expect_success ' cat-file --batch="%(rest)" with --batch-all-objects will work' '
600
+ git -C all-two cat-file --batch="%(rest)" <objects >expect &&
601
+ git -C all-two cat-file --batch-all-objects --batch="%(rest)" >actual &&
602
+ cmp expect actual
603
+ '
604
+
605
+ test_expect_success ' cat-file --batch="batman" with --batch-all-objects will work' '
606
+ git -C all-two cat-file --batch="batman" <objects >expect &&
607
+ git -C all-two cat-file --batch-all-objects --batch="batman" >actual &&
608
+ cmp expect actual
609
+ '
610
+
589
611
test_done
You can’t perform that action at this time.
0 commit comments