Skip to content

Commit

Permalink
Remove unused assignments
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benjamin Kramer authored and Junio C Hamano committed Mar 14, 2009
1 parent 7f733de commit 8e76bf3
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 10 deletions.
1 change: 0 additions & 1 deletion builtin-diff-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)

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);
Expand Down
1 change: 0 additions & 1 deletion builtin-for-each-ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,6 @@ static int opt_parse_sort(const struct option *opt, const char *arg, int unset)
return -1;

*sort_tail = s = xcalloc(1, sizeof(*s));
sort_tail = &s->next;

if (*arg == '-') {
s->reverse = 1;
Expand Down
1 change: 0 additions & 1 deletion builtin-mailinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,6 @@ static int decode_header_bq(struct strbuf *it)
*/
strbuf_add(&outbuf, in, ep - in);
}
in = ep;
}
/* E.g.
* ep : "=?iso-2022-jp?B?GyR...?= foo"
Expand Down
1 change: 0 additions & 1 deletion builtin-shortlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ static void insert_one_record(struct shortlog *log,
}
while (*oneline && isspace(*oneline) && *oneline != '\n')
oneline++;
len = eol - oneline;
format_subject(&subject, oneline, " ");
buffer = strbuf_detach(&subject, NULL);

Expand Down
2 changes: 1 addition & 1 deletion connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
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;
Expand Down
2 changes: 1 addition & 1 deletion imap-send.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ static struct imap_cmd *v_issue_imap_cmd(struct imap_store *ctx,
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;
Expand Down
4 changes: 1 addition & 3 deletions pretty.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ void pp_user_info(const char *what, enum cmit_fmt fmt, struct strbuf *sb,
int namelen;
unsigned long time;
int tz;
const char *filler = " ";

if (fmt == CMIT_FMT_ONELINE)
return;
Expand All @@ -154,15 +153,14 @@ void pp_user_info(const char *what, enum cmit_fmt fmt, struct strbuf *sb,
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);
strbuf_addch(sb, '\n');
} 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:
Expand Down
2 changes: 1 addition & 1 deletion remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ static struct refspec *parse_refspec_internal(int nr_refspec, const char **refsp
int is_glob;
const char *lhs, *rhs;

llen = is_glob = 0;
is_glob = 0;

lhs = refspec[i];
if (*lhs == '+') {
Expand Down

0 comments on commit 8e76bf3

Please sign in to comment.