Merge branch 'jk/warn-add-gitlink'
[gitweb.git] / diff-lib.c
index c82b07dc1eb47b439bd56f50fb4d07cc8218d22a..0c0e20f7c004119cd86bc377722eca6d318cdf5d 100644 (file)
@@ -29,7 +29,7 @@
 static int check_removed(const struct cache_entry *ce, struct stat *st)
 {
        if (lstat(ce->name, st) < 0) {
-               if (errno != ENOENT && errno != ENOTDIR)
+               if (!is_missing_file_error(errno))
                        return -1;
                return 1;
        }
@@ -236,7 +236,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
                old_oid = &ce->oid;
                new_oid = changed ? &null_oid : &ce->oid;
                diff_change(&revs->diffopt, oldmode, newmode,
-                           old_oid->hash, new_oid->hash,
+                           old_oid, new_oid,
                            !is_null_oid(old_oid),
                            !is_null_oid(new_oid),
                            ce->name, 0, dirty_submodule);
@@ -367,7 +367,7 @@ static int show_modified(struct rev_info *revs,
                return 0;
 
        diff_change(&revs->diffopt, oldmode, mode,
-                   old->oid.hash, oid->hash, 1, !is_null_oid(oid),
+                   &old->oid, oid, 1, !is_null_oid(oid),
                    old->name, 0, dirty_submodule);
        return 0;
 }
@@ -409,7 +409,7 @@ static void do_oneway_diff(struct unpack_trees_options *o,
                struct diff_filepair *pair;
                pair = diff_unmerge(&revs->diffopt, idx->name);
                if (tree)
-                       fill_filespec(pair->one, tree->oid.hash, 1,
+                       fill_filespec(pair->one, &tree->oid, 1,
                                      tree->ce_mode);
                return;
        }