Merge branch 'jk/messages-with-excess-lf-fix'

One-line messages to "die" and other helper functions will get LF
added by these helper functions, but many existing messages had an
unnecessary LF at the end, which have been corrected.

* jk/messages-with-excess-lf-fix:
  drop trailing newline from warning/error/die messages
This commit is contained in:
Junio C Hamano
2024-09-12 11:47:23 -07:00
12 changed files with 22 additions and 22 deletions

View File

@ -38,7 +38,7 @@ static void normalize_argv_string(const char **var, const char *input)
*var = input;
if (*var && (**var == '<' || **var == '('))
die("Bad value: %s\n", input);
die("Bad value: %s", input);
}
struct test_data {
@ -78,12 +78,12 @@ static int test_function(struct test_data *data, char *(*func)(char *input),
if (!strcmp(to, data[i].to))
continue;
if (!data[i].alternative)
error("FAIL: %s(%s) => '%s' != '%s'\n",
error("FAIL: %s(%s) => '%s' != '%s'",
funcname, data[i].from, to, data[i].to);
else if (!strcmp(to, data[i].alternative))
continue;
else
error("FAIL: %s(%s) => '%s' != '%s', '%s'\n",
error("FAIL: %s(%s) => '%s' != '%s', '%s'",
funcname, data[i].from, to, data[i].to,
data[i].alternative);
failed = 1;

View File

@ -62,13 +62,13 @@ int cmd__progress(int argc, const char **argv)
else if (*end == ' ')
title = string_list_insert(&titles, end + 1)->string;
else
die("invalid input: '%s'\n", line.buf);
die("invalid input: '%s'", line.buf);
progress = start_progress(title, total);
} else if (skip_prefix(line.buf, "progress ", (const char **) &end)) {
uint64_t item_count = strtoull(end, &end, 10);
if (*end != '\0')
die("invalid input: '%s'\n", line.buf);
die("invalid input: '%s'", line.buf);
display_progress(progress, item_count);
} else if (skip_prefix(line.buf, "throughput ",
(const char **) &end)) {
@ -76,10 +76,10 @@ int cmd__progress(int argc, const char **argv)
byte_count = strtoull(end, &end, 10);
if (*end != ' ')
die("invalid input: '%s'\n", line.buf);
die("invalid input: '%s'", line.buf);
test_ms = strtoull(end + 1, &end, 10);
if (*end != '\0')
die("invalid input: '%s'\n", line.buf);
die("invalid input: '%s'", line.buf);
progress_test_ns = test_ms * 1000 * 1000;
display_throughput(progress, byte_count);
} else if (!strcmp(line.buf, "update")) {
@ -87,7 +87,7 @@ int cmd__progress(int argc, const char **argv)
} else if (!strcmp(line.buf, "stop")) {
stop_progress(&progress);
} else {
die("invalid input: '%s'\n", line.buf);
die("invalid input: '%s'", line.buf);
}
}
strbuf_release(&line);

View File

@ -67,13 +67,13 @@ int cmd__reach(int ac, const char **av)
peeled = deref_tag_noverify(the_repository, orig);
if (!peeled)
die("failed to load commit for input %s resulting in oid %s\n",
die("failed to load commit for input %s resulting in oid %s",
buf.buf, oid_to_hex(&oid));
c = object_as_type(peeled, OBJ_COMMIT, 0);
if (!c)
die("failed to load commit for input %s resulting in oid %s\n",
die("failed to load commit for input %s resulting in oid %s",
buf.buf, oid_to_hex(&oid));
switch (buf.buf[0]) {