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

[PATCH 1/4] revert: convert resolve_ref() to read_ref_full()

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Dec 12, 2011, 11:20 UTC
Message-ID
<1323688832-32016-1-git-send-email-pclouds@gmail.com>

This is the follow up of c689332 (Convert many resolve_ref() calls to read_ref*() and ref_exists() - 2011-11-13). See the said commit for rationale.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 builtin/revert.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin/revert.c b/builtin/revert.c
index 1ea525c..0c52a83 100644
--- 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"));
-- 
1.7.8.36.g69ee2
Next: Nguyễn Thái Ngọc Duy
Message 1 of 9 in “revert: convert resolve_ref() to read_ref_full()”
  1. 1/4 revert: convert resolve_ref() to read_ref_full()Nguyễn Thái Ngọc Duy, Dec 12, 2011
  2. 2/4 Convert resolve_ref+xstrdup to new resolve_refdup functionNguyễn Thái Ngọc Duy, Dec 12, 2011
  3. Junio C HamanoDec 12, 2011
  4. Convert resolve_ref+xstrdup to new resolve_refdup functionNguyễn Thái Ngọc Duy, Dec 13, 2011
  5. Michael HaggertyDec 13, 2011
  6. Convert resolve_ref+xstrdup to new resolve_refdup functionNguyễn Thái Ngọc Duy, Dec 13, 2011
  7. 3/4 Guard memory overwriting in resolve_ref's static bufferNguyễn Thái Ngọc Duy, Dec 12, 2011
  8. Junio C HamanoDec 13, 2011
  9. 4/4 Rename resolve_ref() to resolve_ref_unsafe()Nguyễn Thái Ngọc Duy, Dec 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.