Skip to content

Commit

Permalink
Merge branch 'js/remove-unused-variables'
Browse files Browse the repository at this point in the history
* js/remove-unused-variables:
  Remove unused variables
  • Loading branch information
Junio C Hamano committed Mar 27, 2011
2 parents 908535c + c0aa335 commit 8194fca
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 19 deletions.
3 changes: 1 addition & 2 deletions builtin/fsck.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,10 @@ static int traverse_reachable(void)
int result = 0;
while (pending.nr) {
struct object_array_entry *entry;
struct object *obj, *parent;
struct object *obj;

entry = pending.objects + --pending.nr;
obj = entry->item;
parent = (struct object *) entry->name;
result |= traverse_one_object(obj);
}
return !!result;
Expand Down
4 changes: 0 additions & 4 deletions builtin/remote-ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,12 @@ static char *strip_escapes(const char *str, const char *service,
size_t rpos = 0;
int escape = 0;
char special = 0;
size_t pslen = 0;
size_t pSlen = 0;
size_t psoff = 0;
struct strbuf ret = STRBUF_INIT;

/* Calculate prefix length for \s and lengths for \s and \S */
if (!strncmp(service, "git-", 4))
psoff = 4;
pSlen = strlen(service);
pslen = pSlen - psoff;

/* Pass the service to command. */
setenv("GIT_EXT_SERVICE", service, 1);
Expand Down
3 changes: 1 addition & 2 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
uintmax_t max_change = 0, max_len = 0;
int total_files = data->nr;
int width, name_width;
const char *reset, *set, *add_c, *del_c;
const char *reset, *add_c, *del_c;
const char *line_prefix = "";
struct strbuf *msg = NULL;

Expand All @@ -1269,7 +1269,6 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)

/* Find the longest filename and max number of changes */
reset = diff_get_color_opt(options, DIFF_RESET);
set = diff_get_color_opt(options, DIFF_PLAIN);
add_c = diff_get_color_opt(options, DIFF_FILE_NEW);
del_c = diff_get_color_opt(options, DIFF_FILE_OLD);

Expand Down
5 changes: 0 additions & 5 deletions reachable.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,11 @@ static void process_tree(struct tree *tree,
static void process_tag(struct tag *tag, struct object_array *p, const char *name)
{
struct object *obj = &tag->object;
struct name_path me;

if (obj->flags & SEEN)
return;
obj->flags |= SEEN;

me.up = NULL;
me.elem = "tag:/";
me.elem_len = 5;

if (parse_tag(tag) < 0)
die("bad tag object %s", sha1_to_hex(obj->sha1));
if (tag->tagged)
Expand Down
3 changes: 1 addition & 2 deletions test-subprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@

int main(int argc, char **argv)
{
const char *prefix;
struct child_process cp;
int nogit = 0;

prefix = setup_git_directory_gently(&nogit);
setup_git_directory_gently(&nogit);
if (nogit)
die("No git repo found");
if (!strcmp(argv[1], "--setup-work-tree")) {
Expand Down
3 changes: 1 addition & 2 deletions transport-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,9 @@ static int push_refs_with_push(struct transport *transport,
int mirror = flags & TRANSPORT_PUSH_MIRROR;
struct helper_data *data = transport->data;
struct strbuf buf = STRBUF_INIT;
struct child_process *helper;
struct ref *ref;

helper = get_helper(transport);
get_helper(transport);
if (!data->push)
return 1;

Expand Down
3 changes: 1 addition & 2 deletions tree-diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ static int compare_tree_entry(struct tree_desc *t1, struct tree_desc *t2,
const unsigned char *sha1, *sha2;
int cmp, pathlen1, pathlen2;
int old_baselen = base->len;
int retval = 0;

sha1 = tree_entry_extract(t1, &path1, &mode1);
sha2 = tree_entry_extract(t2, &path2, &mode2);
Expand Down Expand Up @@ -53,7 +52,7 @@ static int compare_tree_entry(struct tree_desc *t1, struct tree_desc *t2,
sha1, sha2, base->buf, 0, 0);
}
strbuf_addch(base, '/');
retval = diff_tree_sha1(sha1, sha2, base->buf, opt);
diff_tree_sha1(sha1, sha2, base->buf, opt);
} else {
opt->change(opt, mode1, mode2, sha1, sha2, base->buf, 0, 0);
}
Expand Down

0 comments on commit 8194fca

Please sign in to comment.