MCPcopy Create free account
hub / github.com/remotemobprogramming/mob / hasUnpushedCommits

Method hasUnpushedCommits

mob.go:220–234  ·  view source on GitHub ↗
(configuration config.Configuration)

Source from the content-addressed store, hash-verified

218}
219
220func (branch Branch) hasUnpushedCommits(configuration config.Configuration) bool {
221 countOutput := silentgit(
222 "rev-list", "--count", "--left-only",
223 "refs/heads/"+branch.Name+"..."+"refs/remotes/"+branch.remote(configuration).Name,
224 )
225 unpushedCount, err := strconv.Atoi(countOutput)
226 if err != nil {
227 panic(err)
228 }
229 unpushedCommits := unpushedCount != 0
230 if unpushedCommits {
231 say.Info(fmt.Sprintf("there are %d unpushed commits on local base branch <%s>", unpushedCount, branch.Name))
232 }
233 return unpushedCommits
234}
235
236func stringContains(list []string, element string) bool {
237 found := false

Callers 1

startFunction · 0.80

Calls 3

remoteMethod · 0.95
InfoFunction · 0.92
silentgitFunction · 0.85

Tested by

no test coverage detected