sha1_file: do not access pack if unneeded
[gitweb.git] / bisect.c
index d88f9bc3dc1f78535b8a801c7f123340bb9c161a..2a2b9b7267acbb8752015d64ec477f64c6047875 100644 (file)
--- a/bisect.c
+++ b/bisect.c
@@ -438,10 +438,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 +666,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;
 
@@ -995,8 +992,10 @@ int bisect_next_all(const char *prefix, int no_checkout)
 
        steps_msg = xstrfmt(Q_("(roughly %d step)", "(roughly %d steps)",
                  steps), steps);
-       /* TRANSLATORS: the last %s will be replaced with
-          "(roughly %d steps)" translation */
+       /*
+        * TRANSLATORS: the last %s will be replaced with "(roughly %d
+        * steps)" translation.
+        */
        printf(Q_("Bisecting: %d revision left to test after this %s\n",
                  "Bisecting: %d revisions left to test after this %s\n",
                  nr), nr, steps_msg);