refactor(cli): diff test (#4422)

- Use a single struct and implementation for common functionality
- set type in Mode() for directories
- nit: fix typo
This commit is contained in:
Julio López
2025-02-21 21:57:22 -08:00
committed by GitHub
parent 77448b7379
commit 8f632e4e1f
2 changed files with 61 additions and 45 deletions

View File

@@ -47,7 +47,7 @@ func (c *commandDiff) run(ctx context.Context, rep repo.Repository) error {
_, isDir2 := ent2.(fs.Directory)
if isDir1 != isDir2 {
return errors.New("arguments do diff must both be directories or both non-directories")
return errors.New("arguments to diff must both be directories or both non-directories")
}
d, err := diff.NewComparer(c.out.stdout())