Run rebase sequence editor through shell
This commit is contained in:
@@ -19,8 +19,8 @@ android {
|
|||||||
applicationId = "solutions.tretter.githugandroid"
|
applicationId = "solutions.tretter.githugandroid"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 148
|
versionCode = 149
|
||||||
versionName = "0.1.147"
|
versionName = "0.1.148"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
|||||||
@@ -333,7 +333,7 @@ class GitRepositoryRuntime private constructor(
|
|||||||
|cat ${todoFile.absolutePath.toShellSingleQuoted()} > "$1"
|
|cat ${todoFile.absolutePath.toShellSingleQuoted()} > "$1"
|
||||||
|""".trimMargin(),
|
|""".trimMargin(),
|
||||||
)
|
)
|
||||||
setExecutable(true, true)
|
setReadable(true, true)
|
||||||
}
|
}
|
||||||
val arguments = GitSandboxEngine.tokenizeCommand(invocation.command).drop(1)
|
val arguments = GitSandboxEngine.tokenizeCommand(invocation.command).drop(1)
|
||||||
val result = runGit(
|
val result = runGit(
|
||||||
@@ -341,7 +341,7 @@ class GitRepositoryRuntime private constructor(
|
|||||||
workingDir,
|
workingDir,
|
||||||
arguments,
|
arguments,
|
||||||
mapOf(
|
mapOf(
|
||||||
"GIT_SEQUENCE_EDITOR" to editorScript.absolutePath,
|
"GIT_SEQUENCE_EDITOR" to "${shellExecutable().toShellSingleQuoted()} ${editorScript.absolutePath.toShellSingleQuoted()}",
|
||||||
"GIT_EDITOR" to "true",
|
"GIT_EDITOR" to "true",
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -943,6 +943,14 @@ class GitRepositoryRuntime private constructor(
|
|||||||
return "'" + replace("'", "'\"'\"'") + "'"
|
return "'" + replace("'", "'\"'\"'") + "'"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun shellExecutable(): String {
|
||||||
|
return when {
|
||||||
|
context != null -> "/system/bin/sh"
|
||||||
|
File("/bin/sh").exists() -> "/bin/sh"
|
||||||
|
else -> "sh"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun runGit(
|
private fun runGit(
|
||||||
binary: File,
|
binary: File,
|
||||||
workingDir: File,
|
workingDir: File,
|
||||||
|
|||||||
Reference in New Issue
Block a user