Skip to content

Commit

Permalink
fix: add log for error
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Dec 8, 2023
1 parent 4197a84 commit b3386d7
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,13 @@ class GitCommandManager(var workingDirectory: String = ".", private var lfs: Boo

if (output != null) {
// Satisfy compiler, will always be set
return parseDefaultBranch(output!!.stdout) ?: throw Error("Unexpected output when retrieving default branch")
val defaultBranch = parseDefaultBranch(output!!.stdout)
if (defaultBranch != null) {
return defaultBranch
}
}

logger.info("getDefaultBranch Output Code: ${output!!.stderr}")
throw Error("Unexpected output when retrieving default branch")
}

Expand Down Expand Up @@ -238,6 +242,7 @@ class GitCommandManager(var workingDirectory: String = ".", private var lfs: Boo

result.exitCode = exec.exec(gitPath, args, options)
result.stdout = stdout.joinToString("\n")
result.stderr = stderr.joinToString("\n")

return result
}
Expand Down Expand Up @@ -273,5 +278,6 @@ class GitCommandManager(var workingDirectory: String = ".", private var lfs: Boo

data class GitOutput(
var stdout: String = "",
var exitCode: Int = 0
var exitCode: Int = 0,
var stderr: String = ""
)

0 comments on commit b3386d7

Please sign in to comment.