summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sha1_file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c
index fe73904cbe..6d0a72ed09 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -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)) {