#include "cache.h"
+#include "config.h"
#include "commit.h"
#include "diff.h"
#include "revision.h"
{
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);
/*
* Custom integer square root from
- * http://en.wikipedia.org/wiki/Integer_square_root
+ * https://en.wikipedia.org/wiki/Integer_square_root
*/
static int sqrti(int val)
{
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;
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;
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);