Add git re-entry alias for packaged runtime helpers
- Add a plain git alias in the runtime git-exec directory so Git's internal `git <helper>` re-entry can resolve on Android. - Keep prefixed and unprefixed helper aliases plus GIT_EXEC_PATH/PATH wiring for direct helper lookup. - Verify Push no longer reproduces `cannot run merge-base` or `cannot run fetch` in the host libgit.so runtime tests.
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 = 124
|
versionCode = 125
|
||||||
versionName = "0.1.123"
|
versionName = "0.1.124"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
|||||||
@@ -853,6 +853,7 @@ class GitRepositoryRuntime private constructor(
|
|||||||
.apply {
|
.apply {
|
||||||
environment()["HOME"] = workingDir.absolutePath
|
environment()["HOME"] = workingDir.absolutePath
|
||||||
environment()["GIT_EXEC_PATH"] = gitExecPath.absolutePath
|
environment()["GIT_EXEC_PATH"] = gitExecPath.absolutePath
|
||||||
|
environment()["PATH"] = gitExecPath.absolutePath
|
||||||
environment()["GIT_CONFIG_NOSYSTEM"] = "1"
|
environment()["GIT_CONFIG_NOSYSTEM"] = "1"
|
||||||
environment()["GIT_AUTHOR_NAME"] = "GitHug"
|
environment()["GIT_AUTHOR_NAME"] = "GitHug"
|
||||||
environment()["GIT_AUTHOR_EMAIL"] = "githug@example.com"
|
environment()["GIT_AUTHOR_EMAIL"] = "githug@example.com"
|
||||||
@@ -878,12 +879,19 @@ class GitRepositoryRuntime private constructor(
|
|||||||
}
|
}
|
||||||
directory.mkdirs()
|
directory.mkdirs()
|
||||||
|
|
||||||
RequiredGitCommandAliases.forEach { command ->
|
File(directory, "git").also { alias ->
|
||||||
val alias = File(directory, "git-$command")
|
|
||||||
if (!alias.exists()) {
|
if (!alias.exists()) {
|
||||||
createGitAlias(binary, alias)
|
createGitAlias(binary, alias)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
RequiredGitCommandAliases.forEach { command ->
|
||||||
|
listOf("git-$command", command).forEach { aliasName ->
|
||||||
|
val alias = File(directory, aliasName)
|
||||||
|
if (!alias.exists()) {
|
||||||
|
createGitAlias(binary, alias)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return directory
|
return directory
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user