@@ -160,7 +160,7 @@ func TestBomb(t *testing.T) {
160
160
defer os .RemoveAll (repo .Path ())
161
161
162
162
h , err := sizes .ScanRepositoryUsingGraph (
163
- repo , git .AllReferencesFilter , sizes .NameStyleNone , false ,
163
+ repo , git .AllReferencesFilter , sizes .NameStyleFull , false ,
164
164
)
165
165
if ! assert .NoError (err ) {
166
166
return
@@ -169,31 +169,42 @@ func TestBomb(t *testing.T) {
169
169
assert .Equal (counts .Count32 (1 ), h .UniqueCommitCount , "unique commit count" )
170
170
assert .Equal (counts .Count64 (169 ), h .UniqueCommitSize , "unique commit size" )
171
171
assert .Equal (counts .Count32 (169 ), h .MaxCommitSize , "max commit size" )
172
+ assert .Equal ("refs/heads/master" , h .MaxCommitSizeCommit .Path (), "max commit size commit" )
172
173
assert .Equal (counts .Count32 (1 ), h .MaxHistoryDepth , "max history depth" )
173
174
assert .Equal (counts .Count32 (0 ), h .MaxParentCount , "max parent count" )
175
+ assert .Equal ("refs/heads/master" , h .MaxParentCountCommit .Path (), "max parent count commit" )
174
176
175
177
assert .Equal (counts .Count32 (10 ), h .UniqueTreeCount , "unique tree count" )
176
178
assert .Equal (counts .Count64 (2910 ), h .UniqueTreeSize , "unique tree size" )
177
179
assert .Equal (counts .Count64 (100 ), h .UniqueTreeEntries , "unique tree entries" )
178
180
assert .Equal (counts .Count32 (10 ), h .MaxTreeEntries , "max tree entries" )
181
+ assert .Equal ("refs/heads/master:d0/d0/d0/d0/d0/d0/d0/d0/d0" , h .MaxTreeEntriesTree .Path (), "max tree entries tree" )
179
182
180
183
assert .Equal (counts .Count32 (1 ), h .UniqueBlobCount , "unique blob count" )
181
184
assert .Equal (counts .Count64 (6 ), h .UniqueBlobSize , "unique blob size" )
182
185
assert .Equal (counts .Count32 (6 ), h .MaxBlobSize , "max blob size" )
186
+ assert .Equal ("refs/heads/master:d0/d0/d0/d0/d0/d0/d0/d0/d0/f0" , h .MaxBlobSizeBlob .Path (), "max blob size blob" )
183
187
184
188
assert .Equal (counts .Count32 (0 ), h .UniqueTagCount , "unique tag count" )
185
189
assert .Equal (counts .Count32 (0 ), h .MaxTagDepth , "max tag depth" )
186
190
187
191
assert .Equal (counts .Count32 (1 ), h .ReferenceCount , "reference count" )
188
192
189
193
assert .Equal (counts .Count32 (11 ), h .MaxPathDepth , "max path depth" )
194
+ assert .Equal ("refs/heads/master^{tree}" , h .MaxPathDepthTree .Path (), "max path depth tree" )
190
195
assert .Equal (counts .Count32 (29 ), h .MaxPathLength , "max path length" )
196
+ assert .Equal ("refs/heads/master^{tree}" , h .MaxPathLengthTree .Path (), "max path length tree" )
191
197
192
198
assert .Equal (counts .Count32 ((pow (10 , 10 )- 1 )/ (10 - 1 )), h .MaxExpandedTreeCount , "max expanded tree count" )
199
+ assert .Equal ("refs/heads/master^{tree}" , h .MaxExpandedTreeCountTree .Path (), "max expanded tree count tree" )
193
200
assert .Equal (counts .Count32 (0xffffffff ), h .MaxExpandedBlobCount , "max expanded blob count" )
201
+ assert .Equal ("refs/heads/master^{tree}" , h .MaxExpandedBlobCountTree .Path (), "max expanded blob count tree" )
194
202
assert .Equal (counts .Count64 (6 * pow (10 , 10 )), h .MaxExpandedBlobSize , "max expanded blob size" )
203
+ assert .Equal ("refs/heads/master^{tree}" , h .MaxExpandedBlobSizeTree .Path (), "max expanded blob size tree" )
195
204
assert .Equal (counts .Count32 (0 ), h .MaxExpandedLinkCount , "max expanded link count" )
205
+ assert .Nil (h .MaxExpandedLinkCountTree , "max expanded link count tree" )
196
206
assert .Equal (counts .Count32 (0 ), h .MaxExpandedSubmoduleCount , "max expanded submodule count" )
207
+ assert .Nil (h .MaxExpandedSubmoduleCountTree , "max expanded submodule count tree" )
197
208
}
198
209
199
210
func TestTaggedTags (t * testing.T ) {
@@ -287,7 +298,7 @@ func TestSubmodule(t *testing.T) {
287
298
addFile (t , submPath , submRepo , "submfile2.txt" , "Hello again, submodule!\n " )
288
299
addFile (t , submPath , submRepo , "submfile3.txt" , "Hello again, submodule!\n " )
289
300
290
- cmd = gitCommand (t , submRepo , "commit" , "-m" , "main initial" )
301
+ cmd = gitCommand (t , submRepo , "commit" , "-m" , "subm initial" )
291
302
addAuthorInfo (cmd , & timestamp )
292
303
require .NoError (t , cmd .Run (), "creating subm commit" )
293
304
@@ -298,7 +309,7 @@ func TestSubmodule(t *testing.T) {
298
309
require .NoError (t , err , "initializing main Repository object" )
299
310
addFile (t , mainPath , mainRepo , "mainfile.txt" , "Hello, main!\n " )
300
311
301
- cmd = gitCommand (t , mainRepo , "commit" , "-m" , "subm initial" )
312
+ cmd = gitCommand (t , mainRepo , "commit" , "-m" , "main initial" )
302
313
addAuthorInfo (cmd , & timestamp )
303
314
require .NoError (t , cmd .Run (), "creating main commit" )
304
315
@@ -307,13 +318,18 @@ func TestSubmodule(t *testing.T) {
307
318
cmd .Dir = mainPath
308
319
require .NoError (t , cmd .Run (), "adding submodule" )
309
320
321
+ cmd = gitCommand (t , mainRepo , "commit" , "-m" , "add submodule" )
322
+ addAuthorInfo (cmd , & timestamp )
323
+ require .NoError (t , cmd .Run (), "committing submodule to main" )
324
+
310
325
// Analyze the main repo:
311
326
h , err := sizes .ScanRepositoryUsingGraph (
312
327
mainRepo , git .AllReferencesFilter , sizes .NameStyleNone , false ,
313
328
)
314
329
require .NoError (t , err , "scanning repository" )
315
- assert .Equal (t , counts .Count32 (1 ), h .UniqueBlobCount , "unique blob count" )
316
- assert .Equal (t , counts .Count32 (1 ), h .MaxExpandedBlobCount , "max expanded blob count" )
330
+ assert .Equal (t , counts .Count32 (2 ), h .UniqueBlobCount , "unique blob count" )
331
+ assert .Equal (t , counts .Count32 (2 ), h .MaxExpandedBlobCount , "max expanded blob count" )
332
+ assert .Equal (t , counts .Count32 (1 ), h .MaxExpandedSubmoduleCount , "max expanded submodule count" )
317
333
318
334
// Analyze the submodule:
319
335
submRepo2 , err := git .NewRepository (filepath .Join (mainPath , "sub" ))
0 commit comments