@matheusbsbs / matheus-bagliano / commits / d0d8e14d1b
Fork 0

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

Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Feb 28, 2007 at 11:57 UTC d0d8e14d1bad5f5ad3fb27a6ac819ff4e7006f03
1 file changed +1 -1
sha1_file.c
+1 -1
@@ -2071,7 +2071,7 @@ int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object,
2071 /*
2072 * Convert blobs to git internal format
2073 */
2074 - if (type == OBJ_BLOB) {
2074 + if ((type == OBJ_BLOB) && S_ISREG(st->st_mode)) {
2075 unsigned long nsize = size;
2076 char *nbuf = buf;
2077 if (convert_to_git(path, &nbuf, &nsize)) {