fix: pre-select all in init prompt, preserve agent paths with slashes, fix rollback off-by-one

This commit is contained in:
2026-05-23 11:25:31 +01:00
parent 0dfccbc48f
commit 9633f9ad4c
3 changed files with 54 additions and 7 deletions
+6 -1
View File
@@ -68,7 +68,12 @@ func (r *Repo) IsRepo() bool {
return err == nil
}
// Revert undoes the last N commits with `git revert --no-edit HEAD~N..HEAD`.
// n must be >= 1.
func (r *Repo) Revert(n int) error {
_, err := r.run("revert", "--no-edit", fmt.Sprintf("HEAD~%d..HEAD", n-1))
if n < 1 {
return fmt.Errorf("revert: n must be >= 1, got %d", n)
}
_, err := r.run("revert", "--no-edit", fmt.Sprintf("HEAD~%d..HEAD", n))
return err
}