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

Function gitIgnoreFailure

mob.go:1200–1222  ·  view source on GitHub ↗
(args ...string)

Source from the content-addressed store, hash-verified

1198}
1199
1200func gitIgnoreFailure(args ...string) error {
1201 commandString, output, err := "", "", error(nil)
1202 if GitPassthroughStderrStdout {
1203 commandString, output, err = runCommand("git", args...)
1204 } else {
1205 commandString, output, err = runCommandSilent("git", args...)
1206 }
1207
1208 if err != nil {
1209 if !isGit() {
1210 say.Error("expecting the current working directory to be a git repository.")
1211 Exit(1)
1212 } else {
1213 say.Warning(commandString)
1214 say.Warning(output)
1215 say.Warning(err.Error())
1216 return err
1217 }
1218 }
1219
1220 say.Indented(commandString)
1221 return nil
1222}
1223
1224func gitCommitHash() string {
1225 output, _ := silentgitignorefailure("rev-parse", "HEAD")

Callers 1

doneFunction · 0.85

Calls 6

ErrorFunction · 0.92
WarningFunction · 0.92
IndentedFunction · 0.92
runCommandFunction · 0.85
runCommandSilentFunction · 0.85
isGitFunction · 0.85

Tested by

no test coverage detected