1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-10 14:16:07 +02:00

index_fd(): convert blob only if it is a regular file.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2007-02-28 11:57:39 -08:00
parent 53bca91a7d
commit d0d8e14d1b

View File

@ -2071,7 +2071,7 @@ int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object,
/*
* Convert blobs to git internal format
*/
if (type == OBJ_BLOB) {
if ((type == OBJ_BLOB) && S_ISREG(st->st_mode)) {
unsigned long nsize = size;
char *nbuf = buf;
if (convert_to_git(path, &nbuf, &nsize)) {