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

[PATCH 6/6] sha1_file: convert index_stream to struct object_id

From
Patryk Obara <patryk.obara@gmail.com>
Date
Aug 20, 2017, 20:09 UTC
Message-ID
<e15140dfb7b19a1bcaee23889d62bf05ad6e89be.1503258223.git.patryk.obara@gmail.com>
In-Reply-To
<cover.1503258223.git.patryk.obara@gmail.com>
Signed-off-by: Patryk Obara <patryk.obara@gmail.com>
---
 sha1_file.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sha1_file.c b/sha1_file.c
index 3e2ef4e..8d6960a 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -3655,11 +3655,11 @@ static int index_core(unsigned char *sha1, int fd, size_t size,
  * binary blobs, they generally do not want to get any conversion, and
  * callers should avoid this code path when filters are requested.
  */
-static int index_stream(unsigned char *sha1, int fd, size_t size,
+static int index_stream(struct object_id *oid, int fd, size_t size,
 			enum object_type type, const char *path,
 			unsigned flags)
 {
-	return index_bulk_checkin(sha1, fd, size, type, path, flags);
+	return index_bulk_checkin(oid->hash, fd, size, type, path, flags);
 }
 
 int index_fd(struct object_id *oid, int fd, struct stat *st,
@@ -3680,7 +3680,7 @@ int index_fd(struct object_id *oid, int fd, struct stat *st,
 		ret = index_core(oid->hash, fd, xsize_t(st->st_size), type, path,
 				 flags);
 	else
-		ret = index_stream(oid->hash, fd, xsize_t(st->st_size), type, path,
+		ret = index_stream(oid, fd, xsize_t(st->st_size), type, path,
 				   flags);
 	close(fd);
 	return ret;
-- 
2.9.5
Previous: Patryk ObaraNext: Patryk Obara
Message 4 of 10 in “Convert hash-object to struct object_id”
  1. 0/6 Convert hash-object to struct object_idPatryk Obara, Aug 20, 2017
  2. 1/6 builtin/hash-object: convert to struct object_idPatryk Obara, Aug 20, 2017
  3. 3/6 sha1_file: convert index_path to struct object_idPatryk Obara, Aug 20, 2017
  4. 6/6 sha1_file: convert index_stream to struct object_idPatryk Obara, Aug 20, 2017
  5. 5/6 sha1_file: convert hash_sha1_file_literally to struct object_idPatryk Obara, Aug 20, 2017
  6. brian m. carlsonAug 20, 2017
  7. 2/6 read-cache: convert to struct object_idPatryk Obara, Aug 20, 2017
  8. 4/6 sha1_file: convert index_fd to struct object_idPatryk Obara, Aug 20, 2017
  9. brian m. carlsonAug 20, 2017
  10. Junio C HamanoAug 21, 2017

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.