Merge branch 'rs/xdiff-merge-overlapping-hunks-for-W-context' into maint
[gitweb.git] / builtin / reset.c
index e8c57670304554ec0c91cca819e78b04af59b9c6..9020ec66c81de0185244d478e588d4a05c2a4f1d 100644 (file)
@@ -121,7 +121,7 @@ static void update_index_from_diff(struct diff_queue_struct *q,
 
        for (i = 0; i < q->nr; i++) {
                struct diff_filespec *one = q->queue[i]->one;
-               int is_missing = !(one->mode && !is_null_sha1(one->sha1));
+               int is_missing = !(one->mode && !is_null_oid(&one->oid));
                struct cache_entry *ce;
 
                if (is_missing && !intent_to_add) {
@@ -129,7 +129,7 @@ static void update_index_from_diff(struct diff_queue_struct *q,
                        continue;
                }
 
-               ce = make_cache_entry(one->mode, one->sha1, one->path,
+               ce = make_cache_entry(one->mode, one->oid.hash, one->path,
                                      0, 0);
                if (!ce)
                        die(_("make_cache_entry failed for path '%s'"),
@@ -158,7 +158,7 @@ static int read_from_tree(const struct pathspec *pathspec,
                return 1;
        diffcore_std(&opt);
        diff_flush(&opt);
-       free_pathspec(&opt.pathspec);
+       clear_pathspec(&opt.pathspec);
 
        return 0;
 }