Complete ./ script paths in terminal tab completion
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 = 151
|
versionCode = 152
|
||||||
versionName = "0.1.150"
|
versionName = "0.1.151"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ class GitRepositoryRuntime private constructor(
|
|||||||
?: sandboxRoot
|
?: sandboxRoot
|
||||||
if (!workingDir.exists() || !workingDir.isDirectory) return emptyList()
|
if (!workingDir.exists() || !workingDir.isDirectory) return emptyList()
|
||||||
|
|
||||||
return workingDir.walkTopDown()
|
val relativeCandidates = workingDir.walkTopDown()
|
||||||
.drop(1)
|
.drop(1)
|
||||||
.filter { file -> !directoriesOnly || file.isDirectory }
|
.filter { file -> !directoriesOnly || file.isDirectory }
|
||||||
.map { file ->
|
.map { file ->
|
||||||
@@ -196,6 +196,8 @@ class GitRepositoryRuntime private constructor(
|
|||||||
}
|
}
|
||||||
.filter { it.isNotBlank() }
|
.filter { it.isNotBlank() }
|
||||||
.toList()
|
.toList()
|
||||||
|
|
||||||
|
return relativeCandidates + relativeCandidates.map { "./$it" }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun commandReferenceLines(): List<String> {
|
fun commandReferenceLines(): List<String> {
|
||||||
|
|||||||
@@ -185,6 +185,24 @@ class GitSandboxEngineTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun nativeCompletionIncludesExecutableShortcutPaths() {
|
||||||
|
val git = testGitBinary()
|
||||||
|
assumeTrue(git.exists() && git.canExecute())
|
||||||
|
val root = Files.createTempDirectory("githug-script-completion").toFile()
|
||||||
|
try {
|
||||||
|
val runtime = GitRepositoryRuntime(root, git)
|
||||||
|
val level = bisectLevel()
|
||||||
|
val repo = runtime.prepareLevel(level)
|
||||||
|
|
||||||
|
val candidates = runtime.completionCandidates(level, repo, directoriesOnly = false)
|
||||||
|
|
||||||
|
assertTrue("./test-balance.sh" in candidates)
|
||||||
|
} finally {
|
||||||
|
root.deleteRecursively()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun nativeGitExecAliasesRefreshWhenBinaryChanges() {
|
fun nativeGitExecAliasesRefreshWhenBinaryChanges() {
|
||||||
val git = testGitBinary()
|
val git = testGitBinary()
|
||||||
|
|||||||
Reference in New Issue
Block a user