Skip to content

Commit 3a13375

Browse files
committed
Better branch
1 parent 511b7c6 commit 3a13375

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

private/bufpkg/bufimage/bufimageutil/bufimageutil.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -431,11 +431,10 @@ func (t *transitiveClosure) addElement(
431431
opts *imageFilterOptions,
432432
) error {
433433
descriptorInfo := imageIndex.ByDescriptor[descriptor]
434-
existingMode, ok := t.elements[descriptor]
435-
if existingMode == inclusionModeExcluded {
436-
return nil // already excluded
437-
}
438-
if ok && existingMode != inclusionModeEnclosing {
434+
if existingMode, ok := t.elements[descriptor]; ok && existingMode != inclusionModeExcluded {
435+
if existingMode == inclusionModeExcluded {
436+
return nil // already excluded
437+
}
439438
t.addImport(referrerFile, descriptorInfo.file.Path())
440439
if existingMode == inclusionModeImplicit && !impliedByCustomOption {
441440
// upgrade from implied to explicitly part of closure

0 commit comments

Comments
 (0)