MCPcopy Create free account
hub / github.com/google/gapid / Fetch

Method Fetch

core/git/fetch.go:24–34  ·  view source on GitHub ↗

Fetch performs a `git fetch` call. The number of new CLs locally and remotely for the current branch is returned.

(ctx context.Context)

Source from the content-addressed store, hash-verified

22// Fetch performs a `git fetch` call.
23// The number of new CLs locally and remotely for the current branch is returned.
24func (g Git) Fetch(ctx context.Context) (localNew, remoteNew int, err error) {
25 if _, _, err := g.run(ctx, "fetch"); err != nil {
26 return -1, -1, err
27 }
28 str, _, err := g.run(ctx, "rev-list", "--count", "--left-right", Head+"..."+FetchHead)
29 if err != nil {
30 return -1, -1, err
31 }
32 fmt.Sscanf(str, "%d %d", &localNew, &remoteNew)
33 return localNew, remoteNew, nil
34}

Callers

nothing calls this directly

Calls 1

runMethod · 0.95

Tested by

no test coverage detected