Merge branch 'jk/sha1-loose-object-info-fix' into maint
[gitweb.git] / bisect.c
index aaab6ada2b620e10af5dff2ea894ecf3d44ac9ea..a9fd9fbc61a661ab19e18713b115f868daab2f98 100644 (file)
--- a/bisect.c
+++ b/bisect.c
@@ -1,4 +1,5 @@
 #include "cache.h"
+#include "config.h"
 #include "commit.h"
 #include "diff.h"
 #include "revision.h"
@@ -438,10 +439,7 @@ static void read_bisect_paths(struct argv_array *array)
 {
        struct strbuf str = STRBUF_INIT;
        const char *filename = git_path_bisect_names();
-       FILE *fp = fopen(filename, "r");
-
-       if (!fp)
-               die_errno(_("Could not open file '%s'"), filename);
+       FILE *fp = xfopen(filename, "r");
 
        while (strbuf_getline_lf(&str, fp) != EOF) {
                strbuf_trim(&str);
@@ -669,7 +667,7 @@ static int is_expected_rev(const struct object_id *oid)
        if (stat(filename, &st) || !S_ISREG(st.st_mode))
                return 0;
 
-       fp = fopen(filename, "r");
+       fp = fopen_or_warn(filename, "r");
        if (!fp)
                return 0;
 
@@ -705,7 +703,7 @@ static int bisect_checkout(const unsigned char *bisect_rev, int no_checkout)
 
 static struct commit *get_commit_reference(const struct object_id *oid)
 {
-       struct commit *r = lookup_commit_reference(oid->hash);
+       struct commit *r = lookup_commit_reference(oid);
        if (!r)
                die(_("Not a valid commit name %s"), oid_to_hex(oid));
        return r;