(args ...string)
| 1198 | } |
| 1199 | |
| 1200 | func 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 | |
| 1224 | func gitCommitHash() string { |
| 1225 | output, _ := silentgitignorefailure("rev-parse", "HEAD") |
no test coverage detected