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

[RFC 1/5] Remove unnecessary local in get_ref_sha1.

From
Shawn Pearce <spearce@spearce.org>
Date
May 17, 2006, 09:54 UTC
Message-ID
<20060517095446.GB28529@spearce.org>
Remove unnecessary local in get_ref_sha1.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 refs.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
339dddea51656af46f6c8a2fba7f50d96ae2a434
diff --git a/refs.c b/refs.c
index 6c91ae6..0f3491f 100644
--- a/refs.c
+++ b/refs.c
@@ -220,12 +220,9 @@ static char *ref_lock_file_name(const ch
 
 int get_ref_sha1(const char *ref, unsigned char *sha1)
 {
-	const char *filename;
-
 	if (check_ref_format(ref))
 		return -1;
-	filename = git_path("refs/%s", ref);
-	return read_ref(filename, sha1);
+	return read_ref(git_path("refs/%s", ref), sha1);
 }
 
 static int lock_ref_file(const char *filename, const char *lock_filename,
-- 
1.3.2.g7278
Next: Junio C Hamano
Message 1 of 2 in “[RFC 1/5] Remove unnecessary local in get_ref_sha1.”
  1. Shawn PearceMay 17, 2006
  2. Junio C HamanoMay 17, 2006

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.