remove trailing LF in die() messages
LF at the end of format strings given to die() is redundant because die already adds one on its own. Signed-off-by: Alexander Potashev <aspotashev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Alexander Potashev committed
Jan 4, 2009 at 21:38 UTC
d75307084da5f89329de190bb9b4a3196cec1d0e
16 files changed
+27
-27
builtin-cat-file.c
+1
-1
@@ -137,7 +137,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name)
137
break;
138
139
default:
140
- die("git cat-file: unknown option: %s\n", exp_type);
140
+ die("git cat-file: unknown option: %s", exp_type);
141
}
142
143
if (!buf)
builtin-clone.c
+7
-7
@@ -192,15 +192,15 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)
192
193
dir = opendir(src->buf);
194
if (!dir)
195
- die("failed to open %s\n", src->buf);
195
+ die("failed to open %s", src->buf);
196
197
if (mkdir(dest->buf, 0777)) {
198
if (errno != EEXIST)
199
- die("failed to create directory %s\n", dest->buf);
199
+ die("failed to create directory %s", dest->buf);
200
else if (stat(dest->buf, &buf))
201
- die("failed to stat %s\n", dest->buf);
201
+ die("failed to stat %s", dest->buf);
202
else if (!S_ISDIR(buf.st_mode))
203
- die("%s exists and is not a directory\n", dest->buf);
203
+ die("%s exists and is not a directory", dest->buf);
204
}
205
206
strbuf_addch(src, '/');
@@ -224,16 +224,16 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)
224
}
225
226
if (unlink(dest->buf) && errno != ENOENT)
227
- die("failed to unlink %s\n", dest->buf);
227
+ die("failed to unlink %s", dest->buf);
228
if (!option_no_hardlinks) {
229
if (!link(src->buf, dest->buf))
230
continue;
231
if (option_local)
232
- die("failed to create link %s\n", dest->buf);
232
+ die("failed to create link %s", dest->buf);
233
option_no_hardlinks = 1;
234
}
235
if (copy_file(dest->buf, src->buf, 0666))
236
- die("failed to copy file to %s\n", dest->buf);
236
+ die("failed to copy file to %s", dest->buf);
237
}
238
closedir(dir);
239
}
builtin-fetch.c
+1
-1
@@ -607,7 +607,7 @@ static void set_option(const char *name, const char *value)
607
{
608
int r = transport_set_option(transport, name, value);
609
if (r < 0)
610
- die("Option \"%s\" value \"%s\" is not valid for %s\n",
610
+ die("Option \"%s\" value \"%s\" is not valid for %s",
611
name, value, transport->url);
612
if (r > 0)
613
warning("Option \"%s\" is ignored for %s\n",
builtin-init-db.c
+1
-1
@@ -29,7 +29,7 @@ static void safe_create_dir(const char *dir, int share)
29
}
30
}
31
else if (share && adjust_shared_perm(dir))
32
- die("Could not make %s writable by group\n", dir);
32
+ die("Could not make %s writable by group", dir);
33
}
34
35
static void copy_templates_1(char *path, int baselen,
builtin-log.c
+1
-1
@@ -815,7 +815,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
815
committer = git_committer_info(IDENT_ERROR_ON_NO_NAME);
816
endpos = strchr(committer, '>');
817
if (!endpos)
818
- die("bogus committer info %s\n", committer);
818
+ die("bogus committer info %s", committer);
819
add_signoff = xmemdupz(committer, endpos - committer + 1);
820
}
821
else if (!strcmp(argv[i], "--attach")) {
builtin-mailinfo.c
+1
-1
@@ -494,7 +494,7 @@ static void convert_to_utf8(struct strbuf *line, const char *charset)
494
return;
495
out = reencode_string(line->buf, metainfo_charset, charset);
496
if (!out)
497
- die("cannot convert from %s to %s\n",
497
+ die("cannot convert from %s to %s",
498
charset, metainfo_charset);
499
strbuf_attach(line, out, strlen(out), strlen(out));
500
}
builtin-merge-recursive.c
+1
-1
@@ -33,7 +33,7 @@ int cmd_merge_recursive(int argc, const char **argv, const char *prefix)
33
}
34
35
if (argc < 4)
36
- die("Usage: %s <base>... -- <head> <remote> ...\n", argv[0]);
36
+ die("Usage: %s <base>... -- <head> <remote> ...", argv[0]);
37
38
for (i = 1; i < argc; ++i) {
39
if (!strcmp(argv[i], "--"))
builtin-update-index.c
+1
-1
@@ -486,7 +486,7 @@ static int unresolve_one(const char *path)
486
static void read_head_pointers(void)
487
{
488
if (read_ref("HEAD", head_sha1))
489
- die("No HEAD -- no initial commit yet?\n");
489
+ die("No HEAD -- no initial commit yet?");
490
if (read_ref("MERGE_HEAD", merge_head_sha1)) {
491
fprintf(stderr, "Not in the middle of a merge.\n");
492
exit(0);
connect.c
+1
-1
@@ -315,7 +315,7 @@ static int git_tcp_connect_sock(char *host, int flags)
315
/* Not numeric */
316
struct servent *se = getservbyname(port,"tcp");
317
if ( !se )
318
- die("Unknown port %s\n", port);
318
+ die("Unknown port %s", port);
319
nport = se->s_port;
320
}
321
daemon.c
+1
-1
@@ -716,7 +716,7 @@ static int socksetup(char *listen_addr, int listen_port, int **socklist_p)
716
717
gai = getaddrinfo(listen_addr, pbuf, &hints, &ai0);
718
if (gai)
719
- die("getaddrinfo() failed: %s\n", gai_strerror(gai));
719
+ die("getaddrinfo() failed: %s", gai_strerror(gai));
720
721
for (ai = ai0; ai; ai = ai->ai_next) {
722
int sockfd;
diff.c
+1
-1
@@ -2039,7 +2039,7 @@ static void diff_fill_sha1_info(struct diff_filespec *one)
2039
if (lstat(one->path, &st) < 0)
2040
die("stat %s", one->path);
2041
if (index_path(one->sha1, one->path, &st, 0))
2042
- die("cannot hash %s\n", one->path);
2042
+ die("cannot hash %s", one->path);
2043
}
2044
}
2045
else
git.c
+1
-1
@@ -158,7 +158,7 @@ static int handle_alias(int *argcp, const char ***argv)
158
if (ret >= 0 && WIFEXITED(ret) &&
159
WEXITSTATUS(ret) != 127)
160
exit(WEXITSTATUS(ret));
161
- die("Failed to run '%s' when expanding alias '%s'\n",
161
+ die("Failed to run '%s' when expanding alias '%s'",
162
alias_string + 1, alias_command);
163
}
164
count = split_cmdline(alias_string, &new_argv);
grep.c
+1
-1
@@ -395,7 +395,7 @@ static int match_expr_eval(struct grep_opt *o,
395
h |= match_expr_eval(o, x->u.binary.right, bol, eol, ctx, 1);
396
break;
397
default:
398
- die("Unexpected node type (internal error) %d\n", x->node);
398
+ die("Unexpected node type (internal error) %d", x->node);
399
}
400
if (collect_hits)
401
x->hit |= h;
imap-send.c
+3
-3
@@ -115,9 +115,9 @@ static int nfvasprintf(char **strp, const char *fmt, va_list ap)
115
116
len = vsnprintf(tmp, sizeof(tmp), fmt, ap);
117
if (len < 0)
118
- die("Fatal: Out of memory\n");
118
+ die("Fatal: Out of memory");
119
if (len >= sizeof(tmp))
120
- die("imap command overflow !\n");
120
+ die("imap command overflow!");
121
*strp = xmemdupz(tmp, len);
122
return len;
123
}
@@ -482,7 +482,7 @@ static int nfsnprintf(char *buf, int blen, const char *fmt, ...)
482
483
va_start(va, fmt);
484
if (blen <= 0 || (unsigned)(ret = vsnprintf(buf, blen, fmt, va)) >= (unsigned)blen)
485
- die("Fatal: buffer too small. Please report a bug.\n");
485
+ die("Fatal: buffer too small. Please report a bug.");
486
va_end(va);
487
return ret;
488
}
index-pack.c
+1
-1
@@ -178,7 +178,7 @@ static char *open_pack_file(char *pack_name)
178
} else
179
output_fd = open(pack_name, O_CREAT|O_EXCL|O_RDWR, 0600);
180
if (output_fd < 0)
181
- die("unable to create %s: %s\n", pack_name, strerror(errno));
181
+ die("unable to create %s: %s", pack_name, strerror(errno));
182
pack_fd = output_fd;
183
} else {
184
input_fd = open(pack_name, O_RDONLY);
pack-redundant.c
+4
-4
@@ -463,7 +463,7 @@ static void minimize(struct pack_list **min)
463
pll_free(perm_all);
464
}
465
if (perm_ok == NULL)
466
- die("Internal error: No complete sets found!\n");
466
+ die("Internal error: No complete sets found!");
467
468
/* find the permutation with the smallest size */
469
perm = perm_ok;
@@ -573,14 +573,14 @@ static struct pack_list * add_pack_file(char *filename)
573
struct packed_git *p = packed_git;
574
575
if (strlen(filename) < 40)
576
- die("Bad pack filename: %s\n", filename);
576
+ die("Bad pack filename: %s", filename);
577
578
while (p) {
579
if (strstr(p->pack_name, filename))
580
return add_pack(p);
581
p = p->next;
582
}
583
- die("Filename %s not found in packed_git\n", filename);
583
+ die("Filename %s not found in packed_git", filename);
584
}
585
586
static void load_all(void)
@@ -636,7 +636,7 @@ int main(int argc, char **argv)
636
add_pack_file(*(argv + i++));
637
638
if (local_packs == NULL)
639
- die("Zero packs found!\n");
639
+ die("Zero packs found!");
640
641
load_all_objects();
642