7
7
8
8
static void show_pack_info (struct packed_git * p )
9
9
{
10
- uint32_t nr_objects , i , chain_histogram [MAX_CHAIN + 1 ];
10
+ uint32_t nr_objects , i ;
11
+ int cnt ;
12
+ unsigned long chain_histogram [MAX_CHAIN + 1 ], baseobjects ;
11
13
12
14
nr_objects = p -> num_objects ;
13
15
memset (chain_histogram , 0 , sizeof (chain_histogram ));
16
+ baseobjects = 0 ;
14
17
15
18
for (i = 0 ; i < nr_objects ; i ++ ) {
16
19
const unsigned char * sha1 ;
@@ -29,9 +32,11 @@ static void show_pack_info(struct packed_git *p)
29
32
& delta_chain_length ,
30
33
base_sha1 );
31
34
printf ("%s " , sha1_to_hex (sha1 ));
32
- if (!delta_chain_length )
35
+ if (!delta_chain_length ) {
33
36
printf ("%-6s %lu %lu %" PRIuMAX "\n" ,
34
37
type , size , store_size , (uintmax_t )offset );
38
+ baseobjects ++ ;
39
+ }
35
40
else {
36
41
printf ("%-6s %lu %lu %" PRIuMAX " %u %s\n" ,
37
42
type , size , store_size , (uintmax_t )offset ,
@@ -43,15 +48,21 @@ static void show_pack_info(struct packed_git *p)
43
48
}
44
49
}
45
50
46
- for (i = 0 ; i <= MAX_CHAIN ; i ++ ) {
47
- if (!chain_histogram [i ])
51
+ if (baseobjects )
52
+ printf ("non delta: %lu object%s\n" ,
53
+ baseobjects , baseobjects > 1 ? "s" : "" );
54
+
55
+ for (cnt = 1 ; cnt <= MAX_CHAIN ; cnt ++ ) {
56
+ if (!chain_histogram [cnt ])
48
57
continue ;
49
- printf ("chain length = %" PRIu32 ": %" PRIu32 " object%s\n" , i ,
50
- chain_histogram [i ], chain_histogram [i ] > 1 ? "s" : "" );
58
+ printf ("chain length = %d: %lu object%s\n" , cnt ,
59
+ chain_histogram [cnt ],
60
+ chain_histogram [cnt ] > 1 ? "s" : "" );
51
61
}
52
62
if (chain_histogram [0 ])
53
- printf ("chain length > %d: %" PRIu32 " object%s\n" , MAX_CHAIN ,
54
- chain_histogram [0 ], chain_histogram [0 ] > 1 ? "s" : "" );
63
+ printf ("chain length > %d: %lu object%s\n" , MAX_CHAIN ,
64
+ chain_histogram [0 ],
65
+ chain_histogram [0 ] > 1 ? "s" : "" );
55
66
}
56
67
57
68
static int verify_one_pack (const char * path , int verbose )
0 commit comments