Let agents cancel open questions; fix snapshots missing same-size edits

This commit is contained in:
Ian Gulliver
2026-10-14 22:57:01 -07:00
parent 9039860594
commit f5333586fe
14 changed files with 269 additions and 107 deletions
+9
View File
@@ -45,6 +45,10 @@ func Snapshot(dir string) (string, error) {
if err != nil {
return "", err
}
info, err := os.Stat(index)
if err != nil {
return "", err
}
data, err := os.ReadFile(index)
if err != nil {
return "", err
@@ -64,6 +68,11 @@ func Snapshot(dir string) (string, error) {
if err != nil {
return "", err
}
// git trusts cached stat data for entries older than the index file; a fresh mtime would hide same-size edits.
err = os.Chtimes(tmp.Name(), info.ModTime(), info.ModTime())
if err != nil {
return "", err
}
env := []string{"GIT_INDEX_FILE=" + tmp.Name()}
_, err = runEnv(dir, env, "add", "--all")