Run rebase sequence editor through shell
This commit is contained in:
@@ -333,7 +333,7 @@ class GitRepositoryRuntime private constructor(
|
||||
|cat ${todoFile.absolutePath.toShellSingleQuoted()} > "$1"
|
||||
|""".trimMargin(),
|
||||
)
|
||||
setExecutable(true, true)
|
||||
setReadable(true, true)
|
||||
}
|
||||
val arguments = GitSandboxEngine.tokenizeCommand(invocation.command).drop(1)
|
||||
val result = runGit(
|
||||
@@ -341,7 +341,7 @@ class GitRepositoryRuntime private constructor(
|
||||
workingDir,
|
||||
arguments,
|
||||
mapOf(
|
||||
"GIT_SEQUENCE_EDITOR" to editorScript.absolutePath,
|
||||
"GIT_SEQUENCE_EDITOR" to "${shellExecutable().toShellSingleQuoted()} ${editorScript.absolutePath.toShellSingleQuoted()}",
|
||||
"GIT_EDITOR" to "true",
|
||||
),
|
||||
)
|
||||
@@ -943,6 +943,14 @@ class GitRepositoryRuntime private constructor(
|
||||
return "'" + replace("'", "'\"'\"'") + "'"
|
||||
}
|
||||
|
||||
private fun shellExecutable(): String {
|
||||
return when {
|
||||
context != null -> "/system/bin/sh"
|
||||
File("/bin/sh").exists() -> "/bin/sh"
|
||||
else -> "sh"
|
||||
}
|
||||
}
|
||||
|
||||
private fun runGit(
|
||||
binary: File,
|
||||
workingDir: File,
|
||||
|
||||
Reference in New Issue
Block a user