vendor/libgit2/src/diff_generate.c in rugged-0.26.7 vs vendor/libgit2/src/diff_generate.c in rugged-0.27.0
- old
+ new
@@ -2,13 +2,14 @@
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
-#include "diff.h"
+
#include "diff_generate.h"
+
+#include "diff.h"
#include "patch_generate.h"
#include "fileops.h"
#include "config.h"
#include "attr_file.h"
#include "filter.h"
@@ -386,10 +387,11 @@
static void diff_generated_free(git_diff *d)
{
git_diff_generated *diff = (git_diff_generated *)d;
+ git_attr_session__free(&diff->base.attrsession);
git_vector_free_deep(&diff->base.deltas);
git_pathspec__vfree(&diff->pathspec);
git_pool_clear(&diff->base.pool);
@@ -408,16 +410,17 @@
assert(repo && old_iter && new_iter);
if ((diff = git__calloc(1, sizeof(git_diff_generated))) == NULL)
return NULL;
- GIT_REFCOUNT_INC(diff);
+ GIT_REFCOUNT_INC(&diff->base);
diff->base.type = GIT_DIFF_TYPE_GENERATED;
diff->base.repo = repo;
diff->base.old_src = old_iter->type;
diff->base.new_src = new_iter->type;
diff->base.patch_fn = git_patch_generated_from_diff;
diff->base.free_fn = diff_generated_free;
+ git_attr_session__init(&diff->base.attrsession, repo);
memcpy(&diff->base.opts, &dflt, sizeof(git_diff_options));
git_pool_init(&diff->base.pool, 1);
if (git_vector_init(&diff->base.deltas, 0, git_diff_delta__cmp) < 0) {