Skip to content

Commit 7c78a8a

Browse files
committed
Fix interesting edge-case bug with "parents"/"children" and SharedTags interacting poorly
1 parent 870ac0f commit 7c78a8a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cmd/bashbrew/cmd-deps.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"fmt"
5+
"path"
56

67
"github.com/codegangsta/cli"
78
"pault.ag/go/topsort"
@@ -26,7 +27,6 @@ func cmdFamily(parents bool, c *cli.Context) error {
2627
return cli.NewMultiError(fmt.Errorf(`failed gathering repo list`), err)
2728
}
2829

29-
uniq := c.Bool("uniq")
3030
applyConstraints := c.Bool("apply-constraints")
3131
depth := c.Int("depth")
3232

@@ -99,7 +99,11 @@ func cmdFamily(parents bool, c *cli.Context) error {
9999
continue
100100
}
101101

102-
for _, tag := range r.Tags(namespace, uniq, entry) {
102+
// we can't include SharedTags here or else they'll make "bashbrew parents something:simple" show the parents of the shared tags too ("nats:scratch" leading to both "nats:alpine" *and* "nats:windowsservercore" instead of just "nats:alpine" like it should), so we have to reimplement bits of "r.Tags" to exclude them
103+
tagRepo := path.Join(namespace, r.RepoName)
104+
for i, rawTag := range entry.Tags {
105+
tag := tagRepo+":"+rawTag
106+
103107
nodes := []topsortDepthNodes{}
104108
if parents {
105109
nodes = append(nodes, topsortDepthNodes{

0 commit comments

Comments
 (0)