refactor: isolate expensive IsDirty() call

See toolshed/abra#689
This commit is contained in:
2025-10-03 20:35:09 +02:00
parent 2460dd9438
commit d0ccb805c6
4 changed files with 14 additions and 14 deletions

View File

@ -15,7 +15,12 @@ func TestIsDirty(t *testing.T) {
t.Fatal(err)
}
assert.False(t, r.Dirty)
isDirty, err := r.IsDirty()
if err != nil {
t.Fatal(err)
}
assert.False(t, isDirty)
fpath := filepath.Join(r.Dir, "foo.txt")
f, err := os.Create(fpath)