summaryrefslogtreecommitdiff
path: root/bisect.c
diff options
context:
space:
mode:
Diffstat (limited to 'bisect.c')
-rw-r--r--bisect.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/bisect.c b/bisect.c
index 42aa7aa6aa..dc13319c20 100644
--- a/bisect.c
+++ b/bisect.c
@@ -440,7 +440,7 @@ static void read_bisect_paths(struct argv_array *array)
if (!fp)
die_errno("Could not open file '%s'", filename);
- while (strbuf_getline(&str, fp, '\n') != EOF) {
+ while (strbuf_getline_lf(&str, fp) != EOF) {
strbuf_trim(&str);
if (sq_dequote_to_argv_array(str.buf, array))
die("Badly quoted content in file '%s': %s",
@@ -668,7 +668,7 @@ static int is_expected_rev(const struct object_id *oid)
if (!fp)
return 0;
- if (strbuf_getline(&str, fp, '\n') != EOF)
+ if (strbuf_getline_lf(&str, fp) != EOF)
res = !strcmp(str.buf, oid_to_hex(oid));
strbuf_release(&str);
@@ -708,10 +708,10 @@ static struct commit *get_commit_reference(const unsigned char *sha1)
static struct commit **get_bad_and_good_commits(int *rev_nr)
{
- int len = 1 + good_revs.nr;
- struct commit **rev = xmalloc(len * sizeof(*rev));
+ struct commit **rev;
int i, n = 0;
+ ALLOC_ARRAY(rev, 1 + good_revs.nr);
rev[n++] = get_commit_reference(current_bad_oid->hash);
for (i = 0; i < good_revs.nr; i++)
rev[n++] = get_commit_reference(good_revs.sha1[i]);
@@ -860,8 +860,8 @@ static void check_good_are_ancestors_of_bad(const char *prefix, int no_checkout)
/* Create file BISECT_ANCESTORS_OK. */
fd = open(filename, O_CREAT | O_TRUNC | O_WRONLY, 0600);
if (fd < 0)
- warning("could not create file '%s': %s",
- filename, strerror(errno));
+ warning_errno("could not create file '%s'",
+ filename);
else
close(fd);
done:
@@ -890,6 +890,7 @@ static void show_diff_tree(const char *prefix, struct commit *commit)
if (!opt.diffopt.output_format)
opt.diffopt.output_format = DIFF_FORMAT_RAW;
+ setup_revisions(0, NULL, &opt, NULL);
log_tree_commit(&opt, commit);
}
@@ -910,13 +911,12 @@ void read_bisect_terms(const char **read_bad, const char **read_good)
*read_good = "good";
return;
} else {
- die("could not read file '%s': %s", filename,
- strerror(errno));
+ die_errno("could not read file '%s'", filename);
}
} else {
- strbuf_getline(&str, fp, '\n');
+ strbuf_getline_lf(&str, fp);
*read_bad = strbuf_detach(&str, NULL);
- strbuf_getline(&str, fp, '\n');
+ strbuf_getline_lf(&str, fp);
*read_good = strbuf_detach(&str, NULL);
}
strbuf_release(&str);