git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: v2.15.0-rc2 ref deletion bug

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Oct 24, 2017, 12:43 UTC
Message-ID
<44c489f0-4c72-46a1-61a0-48917d64958b@alum.mit.edu>
In-Reply-To
<ea715dae-b410-d4fb-77c7-2e61b764a343@alum.mit.edu>
On 10/24/2017 01:05 PM, Michael Haggerty wrote:
Show 9 quoted lines
> On 10/24/2017 10:24 AM, Jeff King wrote:
>> I found a potentially serious bug in v2.15.0-rc2 (and earlier release
>> candidates, too) that we may want to deal with before the release.
>>
>> If I do:
>> [...]
>> then at the end we have no refs at all!
> 
> That's a serious bug. I'm looking into it right now.

The fix is trivial (see below). But let me add some tests and make sure that there are no similar breakages in the area, then submit a full patch.

Michael

----------------------------- refs/files-backend.c ----------------------------- index 29eb5e826f..fc3f2abcc6 100644

@@ -2523,15 +2523,15 @@ static int files_transaction_prepare(struct
ref_store *ref_store,
 	 */
 	for (i = 0; i < transaction->nr; i++) {
 		struct ref_update *update = transaction->updates[i];

 		ret = lock_ref_for_update(refs, update, transaction,
 					  head_ref, &affected_refnames, err);
 		if (ret)
-			break;
+			goto cleanup;

 		if (update->flags & REF_DELETING &&
 		    !(update->flags & REF_LOG_ONLY) &&
 		    !(update->flags & REF_ISPRUNING)) {
 			/*
 			 * This reference has to be deleted from
 			 * packed-refs if it exists there.
Previous: Michael HaggertyNext: Jeff King
Message 3 of 4 in “v2.15.0-rc2 ref deletion bug”
  1. Jeff KingOct 24, 2017
  2. Michael HaggertyOct 24, 2017
  3. Michael HaggertyOct 24, 2017
  4. Jeff KingOct 24, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.