vendor/libgit2/src/libgit2/apply.c in rugged-1.6.5 vs vendor/libgit2/src/libgit2/apply.c in rugged-1.7.1
- old
+ new
@@ -17,10 +17,11 @@
#include "futils.h"
#include "delta.h"
#include "zstream.h"
#include "reader.h"
#include "index.h"
+#include "repository.h"
#include "apply.h"
typedef struct {
/* The lines that we allocate ourself are allocated out of the pool.
* (Lines may have been allocated out of the diff.)
@@ -642,11 +643,11 @@
/*
* put the current tree into the postimage as-is - the diff will
* replace any entries contained therein
*/
- if ((error = git_index_new(&postimage)) < 0 ||
+ if ((error = git_index__new(&postimage, repo->oid_type)) < 0 ||
(error = git_index_read_tree(postimage, preimage)) < 0 ||
(error = git_reader_for_index(&post_reader, repo, postimage)) < 0)
goto done;
/*
@@ -849,11 +850,11 @@
* this is not the complete preimage or postimage, it only
* contains the files affected by the patch. We want to avoid
* having the full repo index, so we will limit our checkout
* to only write these files that were affected by the diff.
*/
- if ((error = git_index_new(&preimage)) < 0 ||
- (error = git_index_new(&postimage)) < 0 ||
+ if ((error = git_index__new(&preimage, repo->oid_type)) < 0 ||
+ (error = git_index__new(&postimage, repo->oid_type)) < 0 ||
(error = git_reader_for_index(&post_reader, repo, postimage)) < 0)
goto done;
if (!(opts.flags & GIT_APPLY_CHECK))
if ((error = git_repository_index(&index, repo)) < 0 ||