Skip to content

Commit 18bfd4b

Browse files
committed
TestSubmodule(): the submodule actually has to be committed
1 parent 1b7bb33 commit 18bfd4b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

git_sizer_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,18 @@ func TestSubmodule(t *testing.T) {
307307
cmd.Dir = mainPath
308308
require.NoError(t, cmd.Run(), "adding submodule")
309309

310+
cmd = gitCommand(t, mainRepo, "commit", "-m", "add submodule")
311+
addAuthorInfo(cmd, &timestamp)
312+
require.NoError(t, cmd.Run(), "committing submodule to main")
313+
310314
// Analyze the main repo:
311315
h, err := sizes.ScanRepositoryUsingGraph(
312316
mainRepo, git.AllReferencesFilter, sizes.NameStyleNone, false,
313317
)
314318
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")
319+
assert.Equal(t, counts.Count32(2), h.UniqueBlobCount, "unique blob count")
320+
assert.Equal(t, counts.Count32(2), h.MaxExpandedBlobCount, "max expanded blob count")
321+
assert.Equal(t, counts.Count32(1), h.MaxExpandedSubmoduleCount, "max expanded submodule count")
317322

318323
// Analyze the submodule:
319324
submRepo2, err := git.NewRepository(filepath.Join(mainPath, "sub"))

0 commit comments

Comments
 (0)