Auto-commit after successful build (2026-04-21 21:28:05)
This commit is contained in:
@@ -113,8 +113,12 @@ object GitSandboxEngine {
|
||||
parts.size >= 2 && parts[1] == "status" -> repo to statusLines(repo)
|
||||
parts.size >= 3 && parts[1] == "add" -> {
|
||||
val target = parts[2]
|
||||
val updated = repo.files.map { if (target == "." || it.name == target) it.copy(staged = true) else it }
|
||||
repo.copy(files = updated) to listOf("staged ${if (target == ".") "all files" else target}")
|
||||
if (target != "." && repo.files.none { it.name == target }) {
|
||||
repo to listOf("fatal: pathspec '$target' did not match any files")
|
||||
} else {
|
||||
val updated = repo.files.map { if (target == "." || it.name == target) it.copy(staged = true) else it }
|
||||
repo.copy(files = updated) to listOf("staged ${if (target == ".") "all files" else target}")
|
||||
}
|
||||
}
|
||||
parts.size >= 2 && parts[1] == "commit" -> commit(repo, parts)
|
||||
parts.size >= 2 && parts[1] == "log" -> {
|
||||
|
||||
Reference in New Issue
Block a user