Re: [PATCH] shallow.c: use 'reset_repository_shallow' when appropriate
From: Jonathan Tan <hidden>
Date: 2020-04-22 18:05:22
Taylor Blau [off-list ref] writes:quoted
quoted
quoted
@@ -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/ (local).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.