Skip to content

Commit c2bc443

Browse files
committed
Submodules should include the trac commit of sub-submodules if any.
If you had a submodule with sub-submodules, we'd recurse all the way into the latter and generate all the necessary trac commits, but then we'd forget to include that trac commit as a parent of the first submodule's trac commit. Oops. Fixes #2.
1 parent ccc4bfd commit c2bc443

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

subtrac.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,12 @@ func (c *Cache) tracCommit(path string, commit *object.Commit) (*Trac, error) {
220220
if !seenHeads[h.hash] {
221221
seenHeads[h.hash] = true
222222
newHeads = append(newHeads, h)
223+
if h.tracCommit != nil {
224+
if !seenTracs[h.tracCommit.Hash] {
225+
seenTracs[h.tracCommit.Hash] = true
226+
tracs = append(tracs, h.tracCommit)
227+
}
228+
}
223229
}
224230
}
225231

0 commit comments

Comments
 (0)