MCPcopy Create free account
hub / github.com/cli/cli / IsAncestor

Method IsAncestor

pkg/cmd/repo/sync/git.go:76–84  ·  view source on GitHub ↗
(ancestor, progeny string)

Source from the content-addressed store, hash-verified

74}
75
76func (g *gitExecuter) IsAncestor(ancestor, progeny string) (bool, error) {
77 args := []string{"merge-base", "--is-ancestor", ancestor, progeny}
78 cmd, err := g.client.Command(context.Background(), args...)
79 if err != nil {
80 return false, err
81 }
82 _, err = cmd.Output()
83 return err == nil, nil
84}
85
86func (g *gitExecuter) IsDirty() (bool, error) {
87 changeCount, err := g.client.UncommittedChangeCount(context.Background())

Callers

nothing calls this directly

Calls 2

CommandMethod · 0.80
OutputMethod · 0.65

Tested by

no test coverage detected