From 74a627f04528f7e02f69d8d7947820582ce7ca15 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Mon, 21 Oct 2013 09:07:19 -0700 Subject: Tweak to git_diff_delta structure for nfiles While the base git_diff_delta structure always contains two files, when we introduce conflict data, it will be helpful to have an indicator when an additional file is involved. --- src/diff.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/diff.c') diff --git a/src/diff.c b/src/diff.c index 8dc704d58..37bc737d6 100644 --- a/src/diff.c +++ b/src/diff.c @@ -90,6 +90,7 @@ static int diff_delta__from_one( /* This fn is just for single-sided diffs */ assert(status != GIT_DELTA_MODIFIED); + delta->nfiles = 1; if (delta->status == GIT_DELTA_DELETED) { delta->old_file.mode = entry->mode; @@ -148,6 +149,7 @@ static int diff_delta__from_two( delta = diff_delta__alloc(diff, status, canonical_path); GITERR_CHECK_ALLOC(delta); + delta->nfiles = 2; git_oid_cpy(&delta->old_file.oid, &old_entry->oid); delta->old_file.size = old_entry->file_size; -- cgit v1.2.3