aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Barkalow <barkalow@iabervon.org>2005-07-10 18:27:02 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-10 15:39:08 -0700
commitd5f1befca880ee64230d876535f0f98c5ea6bb86 (patch)
tree2e36388e52b6096efc93ea16d161e14870a3fc07
parenta5eda52bfe8f0afe3abc0c7eaceb487c2ffb7ebb (diff)
downloadgit-d5f1befca880ee64230d876535f0f98c5ea6bb86.tar.gz
git-d5f1befca880ee64230d876535f0f98c5ea6bb86.tar.xz
[PATCH] Remove map_sha1_file
Remove map_sha1_file(), now unused. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--cache.h1
-rw-r--r--sha1_file.c18
2 files changed, 4 insertions, 15 deletions
diff --git a/cache.h b/cache.h
index 4d2bde568..f29afc408 100644
--- a/cache.h
+++ b/cache.h
@@ -165,7 +165,6 @@ extern char *sha1_file_name(const unsigned char *sha1);
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 *);
diff --git a/sha1_file.c b/sha1_file.c
index b13578bdf..15fd6e043 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -487,8 +487,7 @@ int check_sha1_signature(const unsigned char *sha1, void *map, unsigned long siz
}
static void *map_sha1_file_internal(const unsigned char *sha1,
- unsigned long *size,
- int say_error)
+ unsigned long *size)
{
struct stat st;
void *map;
@@ -496,8 +495,6 @@ static void *map_sha1_file_internal(const unsigned char *sha1,
char *filename = find_sha1_file(sha1, &st);
if (!filename) {
- if (say_error)
- error("cannot map sha1 file %s", sha1_to_hex(sha1));
return NULL;
}
@@ -511,8 +508,6 @@ static void *map_sha1_file_internal(const unsigned char *sha1,
break;
/* Fallthrough */
case 0:
- if (say_error)
- perror(filename);
return NULL;
}
@@ -529,11 +524,6 @@ static void *map_sha1_file_internal(const unsigned char *sha1,
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 */
@@ -1007,7 +997,7 @@ int sha1_object_info(const unsigned char *sha1, char *type, unsigned long *sizep
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;
@@ -1046,7 +1036,7 @@ void * read_sha1_file(const unsigned char *sha1, char *type, unsigned long *size
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);
@@ -1226,7 +1216,7 @@ int write_sha1_to_fd(int fd, const unsigned char *sha1)
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;