summaryrefslogtreecommitdiff
path: root/src/diff_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/diff_output.c')
-rw-r--r--src/diff_output.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/diff_output.c b/src/diff_output.c
index 26b073aad..88ccc9d45 100644
--- a/src/diff_output.c
+++ b/src/diff_output.c
@@ -1280,14 +1280,15 @@ static void set_data_from_buffer(
{
file->size = (git_off_t)buffer_len;
file->mode = 0644;
+ map->len = buffer_len;
- if (!buffer)
+ if (!buffer) {
file->flags |= GIT_DIFF_FILE_NO_DATA;
- else
+ map->data = NULL;
+ } else {
+ map->data = (char *)buffer;
git_odb_hash(&file->oid, buffer, buffer_len, GIT_OBJ_BLOB);
-
- map->len = buffer_len;
- map->data = (char *)buffer;
+ }
}
typedef struct {