Remove unused assignments
These variables were always overwritten or the assigned
value was unused:
builtin-diff-tree.c::cmd_diff_tree(): nr_sha1
builtin-for-each-ref.c::opt_parse_sort(): sort_tail
builtin-mailinfo.c::decode_header_bq(): in
builtin-shortlog.c::insert_one_record(): len
connect.c::git_connect(): path
imap-send.c::v_issue_imap_cmd(): n
pretty.c::pp_user_info(): filler
remote::parse_refspec_internal(): llen
Signed-off-by: Benjamin Kramer <benny.kra@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff --git a/builtin-diff-tree.c b/builtin-diff-tree.c
index 8ecefd4..79cedb7 100644
--- a/builtin-diff-tree.c
+++ b/builtin-diff-tree.c
@@ -102,7 +102,6 @@
init_revisions(opt, prefix);
git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
- nr_sha1 = 0;
opt->abbrev = 0;
opt->diff = 1;
argc = setup_revisions(argc, argv, opt, NULL);
diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c
index e46b7ad..5cbb4b0 100644
--- a/builtin-for-each-ref.c
+++ b/builtin-for-each-ref.c
@@ -943,7 +943,6 @@
return -1;
*sort_tail = s = xcalloc(1, sizeof(*s));
- sort_tail = &s->next;
if (*arg == '-') {
s->reverse = 1;
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index 2789ccd..1eeeb4d 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -537,7 +537,6 @@
*/
strbuf_add(&outbuf, in, ep - in);
}
- in = ep;
}
/* E.g.
* ep : "=?iso-2022-jp?B?GyR...?= foo"
diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index badd912..b28091b 100644
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
@@ -101,7 +101,6 @@
}
while (*oneline && isspace(*oneline) && *oneline != '\n')
oneline++;
- len = eol - oneline;
format_subject(&subject, oneline, " ");
buffer = strbuf_detach(&subject, NULL);
diff --git a/connect.c b/connect.c
index 0a35cc1..7636bf9 100644
--- a/connect.c
+++ b/connect.c
@@ -504,7 +504,7 @@
const char *prog, int flags)
{
char *url = xstrdup(url_orig);
- char *host, *path = url;
+ char *host, *path;
char *end;
int c;
struct child_process *conn;
diff --git a/imap-send.c b/imap-send.c
index cb518eb..8154cb2 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -579,7 +579,7 @@
n = socket_write(&imap->buf.sock, cmd->cb.data, cmd->cb.dlen);
free(cmd->cb.data);
if (n != cmd->cb.dlen ||
- (n = socket_write(&imap->buf.sock, "\r\n", 2)) != 2) {
+ socket_write(&imap->buf.sock, "\r\n", 2) != 2) {
free(cmd->cmd);
free(cmd);
return NULL;
diff --git a/pretty.c b/pretty.c
index c018408..efa7024 100644
--- a/pretty.c
+++ b/pretty.c
@@ -135,7 +135,6 @@
int namelen;
unsigned long time;
int tz;
- const char *filler = " ";
if (fmt == CMIT_FMT_ONELINE)
return;
@@ -154,7 +153,6 @@
while (line < name_tail && isspace(name_tail[-1]))
name_tail--;
display_name_length = name_tail - line;
- filler = "";
strbuf_addstr(sb, "From: ");
add_rfc2047(sb, line, display_name_length, encoding);
strbuf_add(sb, name_tail, namelen - display_name_length);
@@ -162,7 +160,7 @@
} else {
strbuf_addf(sb, "%s: %.*s%.*s\n", what,
(fmt == CMIT_FMT_FULLER) ? 4 : 0,
- filler, namelen, line);
+ " ", namelen, line);
}
switch (fmt) {
case CMIT_FMT_MEDIUM:
diff --git a/remote.c b/remote.c
index d7079c6..7efaa02 100644
--- a/remote.c
+++ b/remote.c
@@ -495,7 +495,7 @@
int is_glob;
const char *lhs, *rhs;
- llen = is_glob = 0;
+ is_glob = 0;
lhs = refspec[i];
if (*lhs == '+') {