Re: [PATCH] shallow.c: use 'reset_repository_shallow' when appropriate
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Apr 22, 2020, 18:05 UTC
- Message-ID
- <20200422180515.197584-1-jonathantanmy@google.com>
- In-Reply-To
- <xmqq5zdsmuht.fsf@gitster.c.googlers.com>
Show 20 quoted lines
> Taylor Blau <me@ttaylorr.com> writes:
>
> >> > @@ -414,6 +414,7 @@ void prune_shallow(unsigned options)
> >> > } else {
> >> > unlink(git_path_shallow(the_repository));
> >> > rollback_lock_file(&shallow_lock);
> >> > + reset_repository_shallow(the_repository);
> >> > }
> >>
> >> Here, we reset only after we realize we cannot write the updated
> >> shallow file. Intended?
> >
> > Yes, see this earlier discussion I had about it with Jonathan:
> > https://lore.kernel.org/git/20200416020509.225014-1-jonathantanmy@google.com/.
>
> I did, and then I asked the question, because I couldn't quite get
> if JTan was asking a question similar to the one he asked earlier in
> the message ("do you need a reset in the "else" branch as well?"),
> or if he was saying what he sees there, "the opposite case", was
> good.Sorry for not being clear. My intention was to ask a question similar to the earlier one - in this case, and in the previous case, I think that the reset should happen no matter whether we execute the "if" case or the "else" case, so we should just put it right after the entire "if" statement.