diff --git a/src/main/groovy/nebula/plugin/release/git/command/GitReadCommand.groovy b/src/main/groovy/nebula/plugin/release/git/command/GitReadCommand.groovy index 7289fb4..d5834b9 100644 --- a/src/main/groovy/nebula/plugin/release/git/command/GitReadCommand.groovy +++ b/src/main/groovy/nebula/plugin/release/git/command/GitReadCommand.groovy @@ -26,6 +26,7 @@ abstract class GitReadCommand implements ValueSource commandLineArgs = ["git", "--git-dir=${rootDir.absolutePath}/.git".toString(), "--work-tree=${rootDir.absolutePath}".toString()] commandLineArgs.addAll(args) execOperations.exec { + it.setWorkingDir(rootDir.absolutePath) it.setCommandLine(commandLineArgs) it.standardOutput = output it.errorOutput = error @@ -45,6 +46,7 @@ abstract class GitReadCommand implements ValueSource commandLineArgs = ["git", "--git-dir=${rootDir.absolutePath}/.git".toString(), "--work-tree=${rootDir.absolutePath}".toString()] commandLineArgs.addAll(args) execOperations.exec { + it.setWorkingDir(rootDir.absolutePath) it.setCommandLine(commandLineArgs) it.standardOutput = output it.errorOutput = error diff --git a/src/main/groovy/nebula/plugin/release/git/command/GitWriteCommandsUtil.groovy b/src/main/groovy/nebula/plugin/release/git/command/GitWriteCommandsUtil.groovy index 00ce6eb..d956b48 100644 --- a/src/main/groovy/nebula/plugin/release/git/command/GitWriteCommandsUtil.groovy +++ b/src/main/groovy/nebula/plugin/release/git/command/GitWriteCommandsUtil.groovy @@ -76,6 +76,7 @@ class GitWriteCommandsUtil implements Serializable { List commandLineArgs = ["git", "--git-dir=${rootDir.absolutePath}/.git".toString(), "--work-tree=${rootDir.absolutePath}".toString()] commandLineArgs.addAll(args) execOperations.exec { + it.setWorkingDir(rootDir.absolutePath) it.ignoreExitValue = true it.setCommandLine(commandLineArgs) it.standardOutput = output