Browse Source

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

Signed-off-by: Junio C Hamano <junkio@cox.net>
maint
Junio C Hamano 18 years ago
parent
commit
d0d8e14d1b
  1. 2
      sha1_file.c

2
sha1_file.c

@ -2071,7 +2071,7 @@ int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object, @@ -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)) {

Loading…
Cancel
Save