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

Re: [PATCH 3/5] refs.c: drop dead code checking lock status in `delete_pseudoref()`

From
Jeff King <peff@peff.net>
Date
May 8, 2018, 18:10 UTC
Message-ID
<20180508181034.GB7210@sigill.intra.peff.net>
In-Reply-To
<20180506141031.30204-4-martin.agren@gmail.com>
On Sun, May 06, 2018 at 04:10:29PM +0200, Martin Ågren wrote:
Show 7 quoted lines
> After taking the lock we check whether we got it and die otherwise. But
> since we take the lock using `LOCK_DIE_ON_ERROR`, we would already have
> died.
> 
> Unlike in the previous patch, this function is not prepared for
> indicating errors via a `strbuf err`, so let's just drop the dead code.
> Any improved error-handling can be added later.

I suspect this ought to eventually be converted to return an error, to match the rest of the refs code. And in that sense, this is a step backwards versus leaving the current die_errno in place and dropping the LOCK_DIE_ON_ERROR flag. But it probably doesn't matter much either way, and whoever does the conversion later can deal with it.

-Peff
Previous: David TurnerNext: Martin Ågren
Message 3 of 4 in “refs.c: drop dead code checking lock status in `delete_pseudoref()`”
  1. 3/5 refs.c: drop dead code checking lock status in `delete_pseudoref()`Martin Ågren, May 6, 2018
  2. David TurnerMay 6, 2018
  3. Jeff KingMay 8, 2018
  4. Martin ÅgrenMay 9, 2018

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.