Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 2fa4fff

Browse files
committed
Merge branch 'pw/message-cleanup'
Many error/warning messages had extra trailing newlines that are unnecessary. By Pete Wyckoff * pw/message-cleanup: remove blank filename in error message remove superfluous newlines in error messages
2 parents 29c2a3d + 5eaeda7 commit 2fa4fff

File tree

15 files changed

+24
-24
lines changed

15 files changed

+24
-24
lines changed

builtin/branch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ static int edit_branch_description(const char *branch_name)
663663
fp = fopen(git_path(edit_description), "w");
664664
if ((fwrite(buf.buf, 1, buf.len, fp) < buf.len) || fclose(fp)) {
665665
strbuf_release(&buf);
666-
return error(_("could not write branch description template: %s\n"),
666+
return error(_("could not write branch description template: %s"),
667667
strerror(errno));
668668
}
669669
strbuf_reset(&buf);

builtin/merge-file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)
6363
if (quiet) {
6464
if (!freopen("/dev/null", "w", stderr))
6565
return error("failed to redirect stderr to /dev/null: "
66-
"%s\n", strerror(errno));
66+
"%s", strerror(errno));
6767
}
6868

6969
if (prefix)
@@ -76,7 +76,7 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)
7676
if (read_mmfile(mmfs + i, fname))
7777
return -1;
7878
if (buffer_is_binary(mmfs[i].ptr, mmfs[i].size))
79-
return error("Cannot merge binary files: %s\n",
79+
return error("Cannot merge binary files: %s",
8080
argv[i]);
8181
}
8282

builtin/unpack-objects.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static void *get_data(unsigned long size)
107107
if (stream.total_out == size && ret == Z_STREAM_END)
108108
break;
109109
if (ret != Z_OK) {
110-
error("inflate returned %d\n", ret);
110+
error("inflate returned %d", ret);
111111
free(buf);
112112
buf = NULL;
113113
if (!recover)

compat/win32mmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void *git_mmap(void *start, size_t length, int prot, int flags, int fd, off_t of
3030
temp = MapViewOfFileEx(hmap, FILE_MAP_COPY, h, l, length, start);
3131

3232
if (!CloseHandle(hmap))
33-
warning("unable to close file mapping handle\n");
33+
warning("unable to close file mapping handle");
3434

3535
return temp ? temp : MAP_FAILED;
3636
}

contrib/examples/builtin-fetch--tool.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ int cmd_fetch__tool(int argc, const char **argv, const char *prefix)
518518
filename = git_path("FETCH_HEAD");
519519
fp = fopen(filename, "a");
520520
if (!fp)
521-
return error("cannot open %s: %s\n", filename, strerror(errno));
521+
return error("cannot open %s: %s", filename, strerror(errno));
522522
result = append_fetch_head(fp, argv[2], argv[3],
523523
argv[4], argv[5],
524524
argv[6], !!argv[7][0],
@@ -536,7 +536,7 @@ int cmd_fetch__tool(int argc, const char **argv, const char *prefix)
536536
filename = git_path("FETCH_HEAD");
537537
fp = fopen(filename, "a");
538538
if (!fp)
539-
return error("cannot open %s: %s\n", filename, strerror(errno));
539+
return error("cannot open %s: %s", filename, strerror(errno));
540540
result = fetch_native_store(fp, argv[2], argv[3], argv[4],
541541
verbose, force);
542542
fclose(fp);

fsck.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static int fsck_walk_tree(struct tree *tree, fsck_walk_func walk, void *data)
2727
else if (S_ISREG(entry.mode) || S_ISLNK(entry.mode))
2828
result = walk(&lookup_blob(entry.sha1)->object, OBJ_BLOB, data);
2929
else {
30-
result = error("in tree %s: entry %s has bad mode %.6o\n",
30+
result = error("in tree %s: entry %s has bad mode %.6o",
3131
sha1_to_hex(tree->object.sha1), entry.path, entry.mode);
3232
}
3333
if (result < 0)

http-push.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ static void handle_remote_ls_ctx(struct xml_ctx *ctx, int tag_closed)
11081108
if (repo->path)
11091109
url = repo->path;
11101110
if (strncmp(path, url, repo->path_len))
1111-
error("Parsed path '%s' does not match url: '%s'\n",
1111+
error("Parsed path '%s' does not match url: '%s'",
11121112
path, url);
11131113
else {
11141114
path += repo->path_len;
@@ -1702,7 +1702,7 @@ static int delete_remote_branch(const char *pattern, int force)
17021702
run_active_slot(slot);
17031703
free(url);
17041704
if (results.curl_result != CURLE_OK)
1705-
return error("DELETE request failed (%d/%ld)\n",
1705+
return error("DELETE request failed (%d/%ld)",
17061706
results.curl_result, results.http_code);
17071707
} else {
17081708
free(url);

http.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ static char *fetch_pack_index(unsigned char *sha1, const char *base_url)
917917
tmp = strbuf_detach(&buf, NULL);
918918

919919
if (http_get_file(url, tmp, 0) != HTTP_OK) {
920-
error("Unable to get pack index %s\n", url);
920+
error("Unable to get pack index %s", url);
921921
free(tmp);
922922
tmp = NULL;
923923
}

imap-send.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ static int auth_cram_md5(struct imap_store *ctx, struct imap_cmd *cmd, const cha
10221022

10231023
ret = socket_write(&ctx->imap->buf.sock, response, strlen(response));
10241024
if (ret != strlen(response))
1025-
return error("IMAP error: sending response failed\n");
1025+
return error("IMAP error: sending response failed");
10261026

10271027
free(response);
10281028

ll-merge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static int ll_xdl_merge(const struct ll_merge_driver *drv_unused,
7373
if (buffer_is_binary(orig->ptr, orig->size) ||
7474
buffer_is_binary(src1->ptr, src1->size) ||
7575
buffer_is_binary(src2->ptr, src2->size)) {
76-
warning("Cannot merge binary files: %s (%s vs. %s)\n",
76+
warning("Cannot merge binary files: %s (%s vs. %s)",
7777
path, name1, name2);
7878
return ll_binary_merge(drv_unused, result,
7979
path,

0 commit comments

Comments
 (0)