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

[RFC PATCH 1/3] diff: use the given repo at diff_populate_filespec()

From
Matheus Tavares <matheus.bernardino@usp.br>
Date
Sep 18, 2019, 01:56 UTC
Message-ID
<cac0c5a8979d45225436f310660f6fcf4d0bd7e7.1568771073.git.matheus.bernardino@usp.br>
In-Reply-To
<cover.1568771073.git.matheus.bernardino@usp.br>

diff_populate_filespec() accepts an struct repository "r" as parameter but implicitly uses the_repository when calling read_object_file(). To be more consistent, replace this call with repo_read_object_file(r, ...).

Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
---
 diff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/diff.c b/diff.c
index 663b5d01f8..c743e4ce50 100644
--- a/diff.c
+++ b/diff.c
@@ -4044,7 +4044,7 @@ int diff_populate_filespec(struct repository *r,
 				return 0;
 			}
 		}
-		s->data = read_object_file(&s->oid, &type, &s->size);
+		s->data = repo_read_object_file(r, &s->oid, &type, &s->size);
 		if (!s->data)
 			die("unable to read %s", oid_to_hex(&s->oid));
 		s->should_free = 1;
-- 
2.23.0
Previous: Matheus TavaresNext: Matheus Tavares
Message 2 of 11 in “grep: don't add subrepos to in-memory alternates”
  1. 0/3 grep: don't add subrepos to in-memory alternatesMatheus Tavares, Sep 18, 2019
  2. 1/3 diff: use the given repo at diff_populate_filespec()Matheus Tavares, Sep 18, 2019
  3. 2/3 object: allow parse_object_or_die() to handle any repoMatheus Tavares, Sep 18, 2019
  4. 3/3 grep: don't add submodules to the alternates listMatheus Tavares, Sep 18, 2019
  5. Brandon WilliamsSep 21, 2019
  6. Junio C HamanoSep 18, 2019
  7. Matheus Tavares BernardinoSep 19, 2019
  8. Junio C HamanoSep 20, 2019
  9. Matheus Tavares BernardinoSep 21, 2019
  10. Junio C HamanoSep 28, 2019
  11. Matheus Tavares BernardinoSep 28, 2019

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.