Re: [PATCH v2 1/5] t1011: add testcase demonstrating accidental loss of user modifications
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Feb 16, 2022, 08:51 UTC
- Message-ID
- <220216.86sfsjur8m.gmgdl@evledraar.gmail.com>
- In-Reply-To
- <d50d804af4e17ff1613ae40e3b5cf1b1bd0986a0.1642175983.git.gitgitgadget@gmail.com>
On Fri, Jan 14 2022, Elijah Newren via GitGitGadget wrote:
Show 7 quoted lines
> From: Elijah Newren <newren@gmail.com> > [...] > + test_path_is_file init.t && > + grep -q dirty init.t > [...] > + test_path_is_file init.t && > + grep -q dirty init.t
Maybe I'm missing something, but can these two just be:
grep dirty init.t
I.e. won't grep report errors appropriately here, e.g.:
$ grep foo t
grep: t: Is a directory
$ grep foo x
grep: x: No such file or directoryThe only prior art I could find was the same pattern in your c449947a79d (directory rename detection: files/directories in the way of some renames, 2018-04-19).
It's probably good to lose the "-q" too, unless this output is way too verbose without it. In any case the errors wouldn't be affected.