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

Re: [PATCH] git branch -D: give a better error message when lockfile creation fails

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Sep 26, 2009, 20:12 UTC
Message-ID
<vpqr5tt5ut4.fsf@bauges.imag.fr>
In-Reply-To
<1253972051-31980-1-git-send-email-vmiklos@frugalware.org>
Miklos Vajna <vmiklos@frugalware.org> writes:
Show 13 quoted lines
> diff --git a/refs.c b/refs.c
> index 24865cf..4eb4fc7 100644
> --- a/refs.c
> +++ b/refs.c
> @@ -972,8 +972,10 @@ static int repack_without_ref(const char *refname)
>  	if (!found)
>  		return 0;
>  	fd = hold_lock_file_for_update(&packlock, git_path("packed-refs"), 0);
> -	if (fd < 0)
> +	if (fd < 0) {
> +		unable_to_lock_index(git_path("packed-refs"), errno, 0);
>  		return error("cannot delete '%s' from packed refs", refname);
> +	}

If unable_to_lock_index is called for something other that the index, it should probably be renamed.

Other than that, I like what the patch does (I'm the one who wrote the message for the index ;-) ).

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Miklos Vajna
Message 9 of 9 in “git branch -D: give a better error message when lockfile creation fails”
  1. git branch -D: give a better error message when lockfile creation failsMiklos Vajna, Sep 26, 2009
  2. Jeff KingSep 26, 2009
  3. git branch -D: give a better error message when lockfile creation failsMiklos Vajna, Sep 26, 2009
  4. Shawn O. PearceSep 26, 2009
  5. Matthieu MoySep 26, 2009
  6. git branch -D: give a better error message when lockfile creation failsMiklos Vajna, Sep 26, 2009
  7. Jeff KingSep 27, 2009
  8. Miklos VajnaSep 27, 2009
  9. Matthieu MoySep 26, 2009

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.