Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-10-21 20:07:19 +0400
committerRussell Belfer <rb@github.com>2013-10-21 20:07:19 +0400
commit74a627f04528f7e02f69d8d7947820582ce7ca15 (patch)
treec71d9a9e95bcaa1efc1232f41c56ca8072e84ed4 /src/diff.c
parent10672e3e455eba2d4ca983070ed427caeeb24a6f (diff)
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.
Diffstat (limited to 'src/diff.c')
-rw-r--r--src/diff.c2
1 files changed, 2 insertions, 0 deletions
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;