summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-02-28 11:52:04 -0800
committerJunio C Hamano <junkio@cox.net>2007-02-28 12:00:00 -0800
commit53bca91a7d337ea648197b9642b41a92704c17f7 (patch)
tree28c8d3d7d20fbfb87ed85ca0d0b3804f6e8c43d9 /sha1_file.c
parentedaec3fbe8821a5761e35e9b01937eea9b2544c1 (diff)
downloadgit-53bca91a7d337ea648197b9642b41a92704c17f7.tar.gz
index_fd(): pass optional path parameter as hint for blob conversion
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 38ccf1b809..fe73904cbe 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2054,7 +2054,7 @@ int index_pipe(unsigned char *sha1, int fd, const char *type, int write_object)
}
int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object,
- enum object_type type)
+ enum object_type type, const char *path)
{
unsigned long size = st->st_size;
void *buf;
@@ -2074,7 +2074,7 @@ int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object,
if (type == OBJ_BLOB) {
unsigned long nsize = size;
char *nbuf = buf;
- if (convert_to_git(NULL, &nbuf, &nsize)) {
+ if (convert_to_git(path, &nbuf, &nsize)) {
if (size)
munmap(buf, size);
size = nsize;
@@ -2107,7 +2107,7 @@ int index_path(unsigned char *sha1, const char *path, struct stat *st, int write
if (fd < 0)
return error("open(\"%s\"): %s", path,
strerror(errno));
- if (index_fd(sha1, fd, st, write_object, OBJ_BLOB) < 0)
+ if (index_fd(sha1, fd, st, write_object, OBJ_BLOB, path) < 0)
return error("%s: failed to insert into database",
path);
break;