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

[PATCH 2/2] Remove map_sha1_file

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Jul 10, 2005, 22:27 UTC
Message-ID
<Pine.LNX.4.21.0507101825420.30848-100000@iabervon.org>
In-Reply-To
<Pine.LNX.4.21.0507101811390.30848-100000@iabervon.org>
Remove map_sha1_file(), now unused.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
---
commit c21a02262f770a25b005378e06354e582aa1bfd8
tree 7ac9fabe666f00f37572e7b349fdb859bf8a6491
parent 264ff9f3dcde5553728b34fa08e04643b2b55946
author Daniel Barkalow <barkalow@iabervon.org> 1121033599 -0400
committer Daniel Barkalow <barkalow@silva-tulga.(none)> 1121033599 -0400
Index: cache.h
===================================================================
--- 353fe33ae9c7265d7b685bca864d657e3efe2849/cache.h  (mode:100644 sha1:38dac6d6a413f1c788e5331ef4741fc15d72d9bd)
+++ 7ac9fabe666f00f37572e7b349fdb859bf8a6491/cache.h  (mode:100644 sha1:11ba95c8aa9202fa3b1a3cbc07bc976641cd1908)
@@ -167,7 +167,6 @@
 int safe_create_leading_directories(char *path);
 
 /* Read and unpack a sha1 file into memory, write memory to a sha1 file */
-extern void * map_sha1_file(const unsigned char *sha1, unsigned long *size);
 extern int unpack_sha1_header(z_stream *stream, void *map, unsigned long mapsize, void *buffer, unsigned long size);
 extern int parse_sha1_header(char *hdr, char *type, unsigned long *sizep);
 extern int sha1_object_info(const unsigned char *, char *, unsigned long *);
Index: sha1_file.c
===================================================================
--- 353fe33ae9c7265d7b685bca864d657e3efe2849/sha1_file.c  (mode:100644 sha1:08560b2c7a6dff400a46160501c247081f9bb4c7)
+++ 7ac9fabe666f00f37572e7b349fdb859bf8a6491/sha1_file.c  (mode:100644 sha1:e082f2e6cb985caca11979311c291aa51d6c37fd)
@@ -578,8 +578,7 @@
 }
 
 static void *map_sha1_file_internal(const unsigned char *sha1,
-				    unsigned long *size,
-				    int say_error)
+				    unsigned long *size)
 {
 	struct stat st;
 	void *map;
@@ -587,8 +586,6 @@
 	char *filename = find_sha1_file(sha1, &st);
 
 	if (!filename) {
-		if (say_error)
-			error("cannot map sha1 file %s", sha1_to_hex(sha1));
 		return NULL;
 	}
 
@@ -602,8 +599,6 @@
 				break;
 		/* Fallthrough */
 		case 0:
-			if (say_error)
-				perror(filename);
 			return NULL;
 		}
 
@@ -620,11 +615,6 @@
 	return map;
 }
 
-void *map_sha1_file(const unsigned char *sha1, unsigned long *size)
-{
-	return map_sha1_file_internal(sha1, size, 1);
-}
-
 int unpack_sha1_header(z_stream *stream, void *map, unsigned long mapsize, void *buffer, unsigned long size)
 {
 	/* Get the data stream */
@@ -1112,7 +1102,7 @@
 	z_stream stream;
 	char hdr[128];
 
-	map = map_sha1_file_internal(sha1, &mapsize, 0);
+	map = map_sha1_file_internal(sha1, &mapsize);
 	if (!map) {
 		struct pack_entry e;
 
@@ -1151,7 +1141,7 @@
 	unsigned long mapsize;
 	void *map, *buf;
 
-	map = map_sha1_file_internal(sha1, &mapsize, 0);
+	map = map_sha1_file_internal(sha1, &mapsize);
 	if (map) {
 		buf = unpack_sha1_file(map, mapsize, type, size);
 		munmap(map, mapsize);
@@ -1331,7 +1321,7 @@
 	ssize_t size;
 	unsigned long objsize;
 	int posn = 0;
-	char *buf = map_sha1_file_internal(sha1, &objsize, 0);
+	char *buf = map_sha1_file_internal(sha1, &objsize);
 	z_stream stream;
 	if (!buf) {
 		unsigned char *unpacked;
Previous: Daniel Barkalow
Message 3 of 3 in “Handing sending objects from packs”
  1. 0/2 Handing sending objects from packsDaniel Barkalow, Jul 10, 2005
  2. 1/2 write_sha1_to_fd()Daniel Barkalow, Jul 10, 2005
  3. 2/2 Remove map_sha1_fileDaniel Barkalow, Jul 10, 2005

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.