Re: [RFC PATCH] pack-refs: fail on falsely sorted packed-refs
- From
Max Kirillov <max@max630.net>
- Date
- Jan 31, 2019, 08:21 UTC
- Message-ID
- <20190131082140.GA24787@jessie.local>
- In-Reply-To
- <CAPig+cTn2gURyQgWHZQMNf2cZ+zwFhbH1Q4iPmbwuvYjMrPZPg@mail.gmail.com>
On Wed, Jan 30, 2019 at 06:31:34PM -0500, Eric Sunshine wrote:
> On Wed, Jan 30, 2019 at 6:21 PM Max Kirillov <max@max630.net> wrote: >> + strbuf_addf(err, "broken sorting in packed-refs: '%s' > '%s'", >> + prev_ref.buf, >> + iter->refname);
> strbuf_release(&prev_ref) either here or after the "error" label.
Thanks! I seem to forget about it.
> > + git branch b$(printf "%02d" $num) || break
> This should probably be "|| return 1" rather than "|| break" in order > to fail the test immediately.
I've been looking for the correct way, and have seen the break somewhere. Now I see the "return 1" is mostly user. Thanks, will fix.
> Use test_must_fail() rather than '!' when expecting a Git command to fail.
Will fix in both places