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

Re: [PATCH 1/3] Convert resolve_ref+xstrdup to new resolve_refdup function

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Dec 10, 2011, 13:15 UTC
Message-ID
<20111210131503.GI22035@elie.hsd1.il.comcast.net>
In-Reply-To
<1323521631-24320-1-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy wrote:
> [Subject: Convert resolve_ref+xstrdup to new resolve_refdup function]
I like it.
Show 11 quoted lines
> --- a/builtin/revert.c
> +++ b/builtin/revert.c
> @@ -901,7 +901,7 @@ static int rollback_single_pick(void)
>  	if (!file_exists(git_path("CHERRY_PICK_HEAD")) &&
>  	    !file_exists(git_path("REVERT_HEAD")))
>  		return error(_("no cherry-pick or revert in progress"));
> -	if (!resolve_ref("HEAD", head_sha1, 0, NULL))
> +	if (read_ref_full("HEAD", head_sha1, 0, NULL))
>  		return error(_("cannot resolve HEAD"));
>  	if (is_null_sha1(head_sha1))
>  		return error(_("cannot abort from a branch yet to be born"));
Unrelated change that snuck in, I assume?
The rest of the patch looks very sensible and no-op-like. :)
Previous: Nguyen Thai Ngoc DuyNext: Nguyen Thai Ngoc Duy
Message 8 of 10 in “Convert resolve_ref+xstrdup to new resolve_refdup function”
  1. 1/3 Convert resolve_ref+xstrdup to new resolve_refdup functionNguyễn Thái Ngọc Duy, Dec 10, 2011
  2. 2/3 Guard memory overwriting in resolve_ref's static bufferNguyễn Thái Ngọc Duy, Dec 10, 2011
  3. Jonathan NiederDec 10, 2011
  4. Nguyen Thai Ngoc DuyDec 11, 2011
  5. 3/3 Rename resolve_ref() to resolve_ref_unsafe()Nguyễn Thái Ngọc Duy, Dec 10, 2011
  6. Jonathan NiederDec 10, 2011
  7. Nguyen Thai Ngoc DuyDec 11, 2011
  8. Jonathan NiederDec 10, 2011
  9. Nguyen Thai Ngoc DuyDec 10, 2011
  10. Junio C HamanoDec 12, 2011

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.