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:
Joe Tretter
2026-05-07 16:28:52 -05:00
parent 83bb5a1457
commit 6444ad07c6
2 changed files with 12 additions and 4 deletions

View File

@@ -19,8 +19,8 @@ android {
applicationId = "solutions.tretter.githugandroid"
minSdk = 26
targetSdk = 35
versionCode = 124
versionName = "0.1.123"
versionCode = 125
versionName = "0.1.124"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true

View File

@@ -853,6 +853,7 @@ class GitRepositoryRuntime private constructor(
.apply {
environment()["HOME"] = workingDir.absolutePath
environment()["GIT_EXEC_PATH"] = gitExecPath.absolutePath
environment()["PATH"] = gitExecPath.absolutePath
environment()["GIT_CONFIG_NOSYSTEM"] = "1"
environment()["GIT_AUTHOR_NAME"] = "GitHug"
environment()["GIT_AUTHOR_EMAIL"] = "githug@example.com"
@@ -878,12 +879,19 @@ class GitRepositoryRuntime private constructor(
}
directory.mkdirs()
RequiredGitCommandAliases.forEach { command ->
val alias = File(directory, "git-$command")
File(directory, "git").also { alias ->
if (!alias.exists()) {
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
}