Re: [PATCH v3] diff-no-index: exit(1) if 'diff --quiet <repo file> <external file>' finds changes
- From
Tim Henigan <tim.henigan@gmail.com>
- Date
- Jun 21, 2012, 15:07 UTC
- Message-ID
- <CAFouethNTzcWq_YKzGz+jRTeCjKZEC2ZYMZuQxkF+5AOTC=x-A@mail.gmail.com>
- In-Reply-To
- <20120620160607.GA12856@sigill.intra.peff.net>
On Wed, Jun 20, 2012 at 12:06 PM, Jeff King <peff@peff.net> wrote:
Show 9 quoted lines
> On Wed, Jun 20, 2012 at 09:38:15AM -0400, Tim Henigan wrote: >> >> Are you planning to send this patch to the list? If not, can I >> include it as 1 of 2 before my patch? If we go that route, I'm not >> sure how to properly show you as the author... > > I'd probably get to it eventually, but I haven't touched it since I sent > it. If you want to include some tests and package it with a commit > message, that would make me very happy.
Thanks, I will do that.
It looks like the best place to add tests is t4010-diff-pathspec.sh. The only cases not tested through other means appear to be:
git diff <file in repo> <relative path outside repo>
git diff <relative path outside repo> <relative path outside repo>Other pathspec variations seem to be covered extensively by other tests (mostly as a side effect). Am I missing other variations that should be checked?
In both cases shown above, we are simply verifying that giving a relative path to diff does not cause it to abort. So it may be sufficient to only test one of the above.
The tests that I added to t4035-diff-quiet.sh already cover both of the cases listed above. Is it worthwhile to duplicate some of those tests in t4010?