remove unnecessary initializations
[jc: I needed to hand merge the changes to the updated codebase, so the result needs to be checked.] Signed-off-by: David Rientjes <rientjes@google.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
David Rientjes committed
Aug 15, 2006 at 10:23 UTC
96f1e58f524fac8607cfc38896b365b6e8365b51
42 files changed
+163
-163
blame.c
+3
-3
@@ -56,9 +56,9 @@ struct patch {
56
static void get_blob(struct commit *commit);
57
58
/* Only used for statistics */
59
-static int num_get_patch = 0;
60
-static int num_commits = 0;
61
-static int patch_time = 0;
59
+static int num_get_patch;
60
+static int num_commits;
61
+static int patch_time;
62
63
struct blame_diff_state {
64
struct xdiff_emit_state xm;
builtin-apply.c
+14
-14
@@ -28,18 +28,18 @@ static int prefix_length = -1;
28
static int newfd = -1;
29
30
static int p_value = 1;
31
-static int allow_binary_replacement = 0;
32
-static int check_index = 0;
33
-static int write_index = 0;
34
-static int cached = 0;
35
-static int diffstat = 0;
36
-static int numstat = 0;
37
-static int summary = 0;
38
-static int check = 0;
31
+static int allow_binary_replacement;
32
+static int check_index;
33
+static int write_index;
34
+static int cached;
35
+static int diffstat;
36
+static int numstat;
37
+static int summary;
38
+static int check;
39
static int apply = 1;
40
-static int apply_in_reverse = 0;
41
-static int no_add = 0;
42
-static int show_index_info = 0;
40
+static int apply_in_reverse;
41
+static int no_add;
42
+static int show_index_info;
43
static int line_termination = '\n';
44
static unsigned long p_context = -1;
45
static const char apply_usage[] =
@@ -51,10 +51,10 @@ static enum whitespace_eol {
51
error_on_whitespace,
52
strip_whitespace,
53
} new_whitespace = warn_on_whitespace;
54
-static int whitespace_error = 0;
54
+static int whitespace_error;
55
static int squelch_whitespace_errors = 5;
56
-static int applied_after_stripping = 0;
57
-static const char *patch_input_file = NULL;
56
+static int applied_after_stripping;
57
+static const char *patch_input_file;
58
59
static void parse_whitespace_option(const char *option)
60
{
builtin-fmt-merge-msg.c
+1
-1
@@ -8,7 +8,7 @@
8
static const char *fmt_merge_msg_usage =
9
"git-fmt-merge-msg [--summary] [--no-summary] [--file <file>]";
10
11
-static int merge_summary = 0;
11
+static int merge_summary;
12
13
static int fmt_merge_msg_config(const char *key, const char *value)
14
{
builtin-ls-files.c
+14
-13
@@ -12,21 +12,22 @@
12
#include "dir.h"
13
#include "builtin.h"
14
15
-static int abbrev = 0;
16
-static int show_deleted = 0;
17
-static int show_cached = 0;
18
-static int show_others = 0;
19
-static int show_stage = 0;
20
-static int show_unmerged = 0;
21
-static int show_modified = 0;
22
-static int show_killed = 0;
23
-static int show_valid_bit = 0;
15
+static int abbrev;
16
+static int show_deleted;
17
+static int show_cached;
18
+static int show_others;
19
+static int show_stage;
20
+static int show_unmerged;
21
+static int show_modified;
22
+static int show_killed;
23
+static int show_valid_bit;
24
static int line_terminator = '\n';
25
26
-static int prefix_len = 0, prefix_offset = 0;
27
-static const char **pathspec = NULL;
28
-static int error_unmatch = 0;
29
-static char *ps_matched = NULL;
26
+static int prefix_len;
27
+static int prefix_offset;
28
+static const char **pathspec;
29
+static int error_unmatch;
30
+static char *ps_matched;
31
32
static const char *tag_cached = "";
33
static const char *tag_unmerged = "";
builtin-ls-tree.c
+3
-3
@@ -14,10 +14,10 @@ static int line_termination = '\n';
14
#define LS_TREE_ONLY 2
15
#define LS_SHOW_TREES 4
16
#define LS_NAME_ONLY 8
17
-static int abbrev = 0;
18
-static int ls_options = 0;
17
+static int abbrev;
18
+static int ls_options;
19
static const char **pathspec;
20
-static int chomp_prefix = 0;
20
+static int chomp_prefix;
21
static const char *ls_tree_prefix;
22
23
static const char ls_tree_usage[] =
builtin-mailinfo.c
+3
-3
@@ -16,8 +16,8 @@
16
17
static FILE *cmitmsg, *patchfile, *fin, *fout;
18
19
-static int keep_subject = 0;
20
-static const char *metainfo_charset = NULL;
19
+static int keep_subject;
20
+static const char *metainfo_charset;
21
static char line[1000];
22
static char date[1000];
23
static char name[1000];
@@ -31,7 +31,7 @@ static char charset[256];
31
32
static char multipart_boundary[1000];
33
static int multipart_boundary_len;
34
-static int patch_lines = 0;
34
+static int patch_lines;
35
36
static char *sanity_check(char *name, char *email)
37
{
builtin-name-rev.c
+1
-1
@@ -75,7 +75,7 @@ copy_data:
75
}
76
}
77
78
-static int tags_only = 0;
78
+static int tags_only;
79
80
static int name_ref(const char *path, const unsigned char *sha1)
81
{
builtin-pack-objects.c
+14
-14
@@ -53,17 +53,17 @@ struct object_entry {
53
*/
54
55
static unsigned char object_list_sha1[20];
56
-static int non_empty = 0;
57
-static int no_reuse_delta = 0;
58
-static int local = 0;
59
-static int incremental = 0;
56
+static int non_empty;
57
+static int no_reuse_delta;
58
+static int local;
59
+static int incremental;
60
static struct object_entry **sorted_by_sha, **sorted_by_type;
61
-static struct object_entry *objects = NULL;
62
-static int nr_objects = 0, nr_alloc = 0, nr_result = 0;
61
+static struct object_entry *objects;
62
+static int nr_objects, nr_alloc, nr_result;
63
static const char *base_name;
64
static unsigned char pack_file_sha1[20];
65
static int progress = 1;
66
-static volatile sig_atomic_t progress_update = 0;
66
+static volatile sig_atomic_t progress_update;
67
static int window = 10;
68
69
/*
@@ -72,8 +72,8 @@ static int window = 10;
72
* sorted_by_sha is also possible but this was easier to code and faster.
73
* This hashtable is built after all the objects are seen.
74
*/
75
-static int *object_ix = NULL;
76
-static int object_ix_hashsz = 0;
75
+static int *object_ix;
76
+static int object_ix_hashsz;
77
78
/*
79
* Pack index for existing packs give us easy access to the offsets into
@@ -90,15 +90,15 @@ struct pack_revindex {
90
struct packed_git *p;
91
unsigned long *revindex;
92
} *pack_revindex = NULL;
93
-static int pack_revindex_hashsz = 0;
93
+static int pack_revindex_hashsz;
94
95
/*
96
* stats
97
*/
98
-static int written = 0;
99
-static int written_delta = 0;
100
-static int reused = 0;
101
-static int reused_delta = 0;
98
+static int written;
99
+static int written_delta;
100
+static int reused;
101
+static int reused_delta;
102
103
static int pack_revindex_ix(struct packed_git *p)
104
{
builtin-prune.c
+1
-1
@@ -11,7 +11,7 @@
11
#include "cache-tree.h"
12
13
static const char prune_usage[] = "git-prune [-n]";
14
-static int show_only = 0;
14
+static int show_only;
15
static struct rev_info revs;
16
17
static int prune_object(char *path, const char *filename, const unsigned char *sha1)
builtin-push.c
+4
-4
@@ -10,14 +10,14 @@
10
11
static const char push_usage[] = "git-push [--all] [--tags] [-f | --force] <repository> [<refspec>...]";
12
13
-static int all = 0, tags = 0, force = 0, thin = 1;
14
-static const char *execute = NULL;
13
+static int all, tags, force, thin = 1;
14
+static const char *execute;
15
16
#define BUF_SIZE (2084)
17
static char buffer[BUF_SIZE];
18
19
-static const char **refspec = NULL;
20
-static int refspec_nr = 0;
19
+static const char **refspec;
20
+static int refspec_nr;
21
22
static void add_refspec(const char *ref)
23
{
builtin-read-tree.c
+1
-1
@@ -12,7 +12,7 @@
12
#include "unpack-trees.h"
13
#include "builtin.h"
14
15
-static struct object_list *trees = NULL;
15
+static struct object_list *trees;
16
17
static int list_tree(unsigned char *sha1)
18
{
builtin-repo-config.c
+8
-8
@@ -5,14 +5,14 @@
5
static const char git_config_set_usage[] =
6
"git-repo-config [ --bool | --int ] [--get | --get-all | --get-regexp | --replace-all | --unset | --unset-all] name [value [value_regex]] | --list";
7
8
-static char* key = NULL;
9
-static regex_t* key_regexp = NULL;
10
-static regex_t* regexp = NULL;
11
-static int show_keys = 0;
12
-static int use_key_regexp = 0;
13
-static int do_all = 0;
14
-static int do_not_match = 0;
15
-static int seen = 0;
8
+static char *key;
9
+static regex_t *key_regexp;
10
+static regex_t *regexp;
11
+static int show_keys;
12
+static int use_key_regexp;
13
+static int do_all;
14
+static int do_not_match;
15
+static int seen;
16
static enum { T_RAW, T_INT, T_BOOL } type = T_RAW;
17
18
static int show_all_config(const char *key_, const char *value_)
builtin-rev-list.c
+3
-3
@@ -39,9 +39,9 @@ static const char rev_list_usage[] =
39
40
static struct rev_info revs;
41
42
-static int bisect_list = 0;
43
-static int show_timestamp = 0;
44
-static int hdr_termination = 0;
42
+static int bisect_list;
43
+static int show_timestamp;
44
+static int hdr_termination;
45
static const char *header_prefix;
46
47
static void show_commit(struct commit *commit)
builtin-rev-parse.c
+5
-5
@@ -15,16 +15,16 @@
15
#define DO_NONFLAGS 8
16
static int filter = ~0;
17
18
-static const char *def = NULL;
18
+static const char *def;
19
20
#define NORMAL 0
21
#define REVERSED 1
22
static int show_type = NORMAL;
23
-static int symbolic = 0;
24
-static int abbrev = 0;
25
-static int output_sq = 0;
23
+static int symbolic;
24
+static int abbrev;
25
+static int output_sq;
26
27
-static int revs_count = 0;
27
+static int revs_count;
28
29
/*
30
* Some arguments are relevant "revision" arguments,
builtin-show-branch.c
+3
-3
@@ -8,9 +8,9 @@
8
static const char show_branch_usage[] =
9
"git-show-branch [--sparse] [--current] [--all] [--heads] [--tags] [--topo-order] [--more=count | --list | --independent | --merge-base ] [--topics] [<refs>...]";
10
11
-static int default_num = 0;
12
-static int default_alloc = 0;
13
-static const char **default_arg = NULL;
11
+static int default_num;
12
+static int default_alloc;
13
+static const char **default_arg;
14
15
#define UNINTERESTING 01
16
builtin-update-index.c
+1
-1
@@ -23,7 +23,7 @@ static int allow_replace;
23
static int info_only;
24
static int force_remove;
25
static int verbose;
26
-static int mark_valid_only = 0;
26
+static int mark_valid_only;
27
#define MARK_VALID 1
28
#define UNMARK_VALID 2
29
commit.c
+3
-3
@@ -727,10 +727,10 @@ struct commit *pop_commit(struct commit_list **stack)
727
728
int count_parents(struct commit * commit)
729
{
730
- int count = 0;
730
+ int count;
731
struct commit_list * parents = commit->parents;
732
- for (count=0;parents; parents=parents->next,count++)
733
- ;
732
+ for (count = 0; parents; parents = parents->next,count++)
733
+ ;
734
return count;
735
}
736
connect.c
+3
-3
@@ -10,7 +10,7 @@
10
#include <netdb.h>
11
#include <signal.h>
12
13
-static char *server_capabilities = NULL;
13
+static char *server_capabilities;
14
15
static int check_ref(const char *name, int len, unsigned int flags)
16
{
@@ -493,8 +493,8 @@ static void git_tcp_connect(int fd[2], char *host)
493
}
494
495
496
-static char *git_proxy_command = NULL;
497
-static const char *rhost_name = NULL;
496
+static char *git_proxy_command;
497
+static const char *rhost_name;
498
static int rhost_len;
499
500
static int git_proxy_command_options(const char *var, const char *value)
daemon.c
+10
-10
@@ -22,24 +22,24 @@ static const char daemon_usage[] =
22
" [--reuseaddr] [--detach] [--pid-file=file] [directory...]";
23
24
/* List of acceptable pathname prefixes */
25
-static char **ok_paths = NULL;
26
-static int strict_paths = 0;
25
+static char **ok_paths;
26
+static int strict_paths;
27
28
/* If this is set, git-daemon-export-ok is not required */
29
-static int export_all_trees = 0;
29
+static int export_all_trees;
30
31
/* Take all paths relative to this one if non-NULL */
32
-static char *base_path = NULL;
32
+static char *base_path;
33
34
/* If defined, ~user notation is allowed and the string is inserted
35
* after ~user/. E.g. a request to git://host/~alice/frotz would
36
* go to /home/alice/pub_git/frotz with --user-path=pub_git.
37
*/
38
-static const char *user_path = NULL;
38
+static const char *user_path;
39
40
/* Timeout, and initial timeout */
41
-static unsigned int timeout = 0;
42
-static unsigned int init_timeout = 0;
41
+static unsigned int timeout;
42
+static unsigned int init_timeout;
43
44
static void logreport(int priority, const char *err, va_list params)
45
{
@@ -333,12 +333,12 @@ static int execute(struct sockaddr *addr)
333
static int max_connections = 25;
334
335
/* These are updated by the signal handler */
336
-static volatile unsigned int children_reaped = 0;
336
+static volatile unsigned int children_reaped;
337
static pid_t dead_child[MAX_CHILDREN];
338
339
/* These are updated by the main loop */
340
-static unsigned int children_spawned = 0;
341
-static unsigned int children_deleted = 0;
340
+static unsigned int children_spawned;
341
+static unsigned int children_deleted;
342
343
static struct child {
344
pid_t pid;
describe.c
+3
-3
@@ -8,12 +8,12 @@
8
static const char describe_usage[] =
9
"git-describe [--all] [--tags] [--abbrev=<n>] <committish>*";
10
11
-static int all = 0; /* Default to annotated tags only */
12
-static int tags = 0; /* But allow any tags if --tags is specified */
11
+static int all; /* Default to annotated tags only */
12
+static int tags; /* But allow any tags if --tags is specified */
13
14
static int abbrev = DEFAULT_ABBREV;
15
16
-static int names = 0, allocs = 0;
16
+static int names, allocs;
17
static struct commit_name {
18
const struct commit *commit;
19
int prio; /* annotated tag = 2, tag = 1, head = 0 */
diff.c
+2
-2
@@ -13,9 +13,9 @@
13
14
static int use_size_cache;
15
16
-static int diff_detect_rename_default = 0;
16
+static int diff_detect_rename_default;
17
static int diff_rename_limit_default = -1;
18
-static int diff_use_color_default = 0;
18
+static int diff_use_color_default;
19
20
/* "\033[1;38;5;2xx;48;5;2xxm\0" is 23 bytes */
21
static char diff_colors[][24] = {
environment.c
+5
-5
@@ -13,14 +13,14 @@ char git_default_email[MAX_GITNAME];
13
char git_default_name[MAX_GITNAME];
14
int use_legacy_headers = 1;
15
int trust_executable_bit = 1;
16
-int assume_unchanged = 0;
17
-int prefer_symlink_refs = 0;
18
-int log_all_ref_updates = 0;
16
+int assume_unchanged;
17
+int prefer_symlink_refs;
18
+int log_all_ref_updates;
19
int warn_ambiguous_refs = 1;
20
-int repository_format_version = 0;
20
+int repository_format_version;
21
char git_commit_encoding[MAX_ENCODING_LENGTH] = "utf-8";
22
int shared_repository = PERM_UMASK;
23
-const char *apply_default_whitespace = NULL;
23
+const char *apply_default_whitespace;
24
int zlib_compression_level = Z_DEFAULT_COMPRESSION;
25
int pager_in_use;
26
int pager_use_color = 1;
exec_cmd.c
+1
-1
@@ -5,7 +5,7 @@
5
6
extern char **environ;
7
static const char *builtin_exec_path = GIT_EXEC_PATH;
8
-static const char *current_exec_path = NULL;
8
+static const char *current_exec_path;
9
10
void git_set_exec_path(const char *exec_path)
11
{
fetch-pack.c
+3
-3
@@ -24,8 +24,8 @@ static const char *exec = "git-upload-pack";
24
*/
25
#define MAX_IN_VAIN 256
26
27
-static struct commit_list *rev_list = NULL;
28
-static int non_common_revs = 0, multi_ack = 0, use_thin_pack = 0, use_sideband;
27
+static struct commit_list *rev_list;
28
+static int non_common_revs, multi_ack, use_thin_pack, use_sideband;
29
30
static void rev_list_push(struct commit *commit, int mark)
31
{
@@ -250,7 +250,7 @@ done:
250
return retval;
251
}
252
253
-static struct commit_list *complete = NULL;
253
+static struct commit_list *complete;
254
255
static int mark_complete(const char *path, const unsigned char *sha1)
256
{
fsck-objects.c
+7
-7
@@ -14,12 +14,12 @@
14
#define REACHABLE 0x0001
15
#define SEEN 0x0002
16
17
-static int show_root = 0;
18
-static int show_tags = 0;
19
-static int show_unreachable = 0;
20
-static int check_full = 0;
21
-static int check_strict = 0;
22
-static int keep_cache_objects = 0;
17
+static int show_root;
18
+static int show_tags;
19
+static int show_unreachable;
20
+static int check_full;
21
+static int check_strict;
22
+static int keep_cache_objects;
23
static unsigned char head_sha1[20];
24
25
#ifdef NO_D_INO_IN_DIRENT
@@ -400,7 +400,7 @@ static void fsck_dir(int i, char *path)
400
closedir(dir);
401
}
402
403
-static int default_refs = 0;
403
+static int default_refs;
404
405
static int fsck_handle_ref(const char *refname, const unsigned char *sha1)
406
{
git.c
+1
-1
@@ -92,7 +92,7 @@ static int handle_options(const char*** argv, int* argc)
92
}
93
94
static const char *alias_command;
95
-static char *alias_string = NULL;
95
+static char *alias_string;
96
97
static int git_alias_config(const char *var, const char *value)
98
{
help.c
+1
-1
@@ -14,7 +14,7 @@
14
static int term_columns(void)
15
{
16
char *col_string = getenv("COLUMNS");
17
- int n_cols = 0;
17
+ int n_cols;
18
19
if (col_string && (n_cols = atoi(col_string)) > 0)
20
return n_cols;
http-fetch.c
+4
-4
@@ -36,10 +36,10 @@ enum XML_Status {
36
#define PREV_BUF_SIZE 4096
37
#define RANGE_HEADER_SIZE 30
38
39
-static int commits_on_stdin = 0;
39
+static int commits_on_stdin;
40
41
static int got_alternates = -1;
42
-static int corrupt_object_found = 0;
42
+static int corrupt_object_found;
43
44
static struct curl_slist *no_pragma_header;
45
@@ -52,7 +52,7 @@ struct alt_base
52
struct alt_base *next;
53
};
54
55
-static struct alt_base *alt = NULL;
55
+static struct alt_base *alt;
56
57
enum object_request_state {
58
WAITING,
@@ -114,7 +114,7 @@ struct remote_ls_ctx
114
};
115
#endif
116
117
-static struct object_request *object_queue_head = NULL;
117
+static struct object_request *object_queue_head;
118
119
static size_t fwrite_sha1_file(void *ptr, size_t eltsize, size_t nmemb,
120
void *data)
http-push.c
+8
-8
@@ -70,18 +70,18 @@ enum XML_Status {
70
/* We allow "recursive" symbolic refs. Only within reason, though */
71
#define MAXDEPTH 5
72
73
-static int pushing = 0;
74
-static int aborted = 0;
73
+static int pushing;
74
+static int aborted;
75
static signed char remote_dir_exists[256];
76
77
static struct curl_slist *no_pragma_header;
78
static struct curl_slist *default_headers;
79
80
-static int push_verbosely = 0;
81
-static int push_all = 0;
82
-static int force_all = 0;
80
+static int push_verbosely;
81
+static int push_all;
82
+static int force_all;
83
84
-static struct object_list *objects = NULL;
84
+static struct object_list *objects;
85
86
struct repo
87
{
@@ -94,7 +94,7 @@ struct repo
94
struct remote_lock *locks;
95
};
96
97
-static struct repo *remote = NULL;
97
+static struct repo *remote;
98
99
enum transfer_state {
100
NEED_FETCH,
@@ -134,7 +134,7 @@ struct transfer_request
134
struct transfer_request *next;
135
};
136
137
-static struct transfer_request *request_queue_head = NULL;
137
+static struct transfer_request *request_queue_head;
138
139
struct xml_ctx
140
{
local-fetch.c
+4
-4
@@ -5,10 +5,10 @@
5
#include "commit.h"
6
#include "fetch.h"
7
8
-static int use_link = 0;
9
-static int use_symlink = 0;
8
+static int use_link;
9
+static int use_symlink;
10
static int use_filecopy = 1;
11
-static int commits_on_stdin = 0;
11
+static int commits_on_stdin;
12
13
static const char *path; /* "Remote" git repository */
14
@@ -16,7 +16,7 @@ void prefetch(unsigned char *sha1)
16
{
17
}
18
19
-static struct packed_git *packs = NULL;
19
+static struct packed_git *packs;
20
21
static void setup_index(unsigned char *sha1)
22
{
merge-base.c
+1
-1
@@ -2,7 +2,7 @@
2
#include "cache.h"
3
#include "commit.h"
4
5
-static int show_all = 0;
5
+static int show_all;
6
7
static int merge_base(struct commit *rev1, struct commit *rev2)
8
{
merge-index.c
+1
-1
@@ -4,7 +4,7 @@
4
5
#include "cache.h"
6
7
-static const char *pgm = NULL;
7
+static const char *pgm;
8
static const char *arguments[8];
9
static int one_shot, quiet;
10
static int err;
mktree.c
-1
@@ -49,7 +49,6 @@ static void write_tree(unsigned char *sha1)
49
int i;
50
51
qsort(entries, used, sizeof(*entries), ent_compare);
52
- size = 100;
52
for (size = i = 0; i < used; i++)
53
size += 32 + entries[i]->len;
54
buffer = xmalloc(size);
pack-redundant.c
+2
-2
@@ -13,7 +13,7 @@
13
static const char pack_redundant_usage[] =
14
"git-pack-redundant [ --verbose ] [ --alt-odb ] < --all | <.pack filename> ...>";
15
16
-static int load_all_packs = 0, verbose = 0, alt_odb = 0;
16
+static int load_all_packs, verbose, alt_odb;
17
18
struct llist_item {
19
struct llist_item *next;
@@ -37,7 +37,7 @@ struct pll {
37
struct pack_list *pl;
38
};
39
40
-static struct llist_item *free_nodes = NULL;
40
+static struct llist_item *free_nodes;
41
42
static inline void llist_item_put(struct llist_item *item)
43
{
read-cache.c
+6
-6
@@ -19,16 +19,16 @@
19
#define CACHE_EXT(s) ( (s[0]<<24)|(s[1]<<16)|(s[2]<<8)|(s[3]) )
20
#define CACHE_EXT_TREE 0x54524545 /* "TREE" */
21
22
-struct cache_entry **active_cache = NULL;
22
+struct cache_entry **active_cache;
23
static time_t index_file_timestamp;
24
-unsigned int active_nr = 0, active_alloc = 0, active_cache_changed = 0;
24
+unsigned int active_nr, active_alloc, active_cache_changed;
25
26
-struct cache_tree *active_cache_tree = NULL;
26
+struct cache_tree *active_cache_tree;
27
28
-int cache_errno = 0;
28
+int cache_errno;
29
30
-static void *cache_mmap = NULL;
31
-static size_t cache_mmap_size = 0;
30
+static void *cache_mmap;
31
+static size_t cache_mmap_size;
32
33
/*
34
* This only updates the "non-critical" parts of the directory
receive-pack.c
+3
-3
@@ -8,10 +8,10 @@ static const char receive_pack_usage[] = "git-receive-pack <git-dir>";
8
9
static const char *unpacker[] = { "unpack-objects", NULL };
10
11
-static int report_status = 0;
11
+static int report_status;
12
13
static char capabilities[] = "report-status";
14
-static int capabilities_sent = 0;
14
+static int capabilities_sent;
15
16
static int show_ref(const char *path, const unsigned char *sha1)
17
{
@@ -40,7 +40,7 @@ struct command {
40
char ref_name[FLEX_ARRAY]; /* more */
41
};
42
43
-static struct command *commands = NULL;
43
+static struct command *commands;
44
45
static int is_all_zeroes(const char *hex)
46
{
send-pack.c
+4
-4
@@ -9,10 +9,10 @@ static const char send_pack_usage[] =
9
"git-send-pack [--all] [--exec=git-receive-pack] <remote> [<head>...]\n"
10
" --all and explicit <head> specification are mutually exclusive.";
11
static const char *exec = "git-receive-pack";
12
-static int verbose = 0;
13
-static int send_all = 0;
14
-static int force_update = 0;
15
-static int use_thin_pack = 0;
12
+static int verbose;
13
+static int send_all;
14
+static int force_update;
15
+static int use_thin_pack;
16
17
static int is_zero_sha1(const unsigned char *sha1)
18
{
sha1_file.c
+1
-1
@@ -22,7 +22,7 @@
22
#endif
23
#endif
24
25
-const unsigned char null_sha1[20] = { 0, };
25
+const unsigned char null_sha1[20];
26
27
static unsigned int sha1_file_open_flag = O_NOATIME;
28
ssh-fetch.c
+4
-4
@@ -17,7 +17,7 @@
17
static int fd_in;
18
static int fd_out;
19
20
-static unsigned char remote_version = 0;
20
+static unsigned char remote_version;
21
static unsigned char local_version = 1;
22
23
static ssize_t force_write(int fd, void *buffer, size_t length)
@@ -36,9 +36,9 @@ static ssize_t force_write(int fd, void *buffer, size_t length)
36
return ret;
37
}
38
39
-static int prefetches = 0;
39
+static int prefetches;
40
41
-static struct object_list *in_transit = NULL;
41
+static struct object_list *in_transit;
42
static struct object_list **end_of_transit = &in_transit;
43
44
void prefetch(unsigned char *sha1)
@@ -59,7 +59,7 @@ void prefetch(unsigned char *sha1)
59
}
60
61
static char conn_buf[4096];
62
-static size_t conn_buf_posn = 0;
62
+static size_t conn_buf_posn;
63
64
int fetch(unsigned char *sha1)
65
{
ssh-upload.c
+2
-2
@@ -15,9 +15,9 @@
15
#include <string.h>
16
17
static unsigned char local_version = 1;
18
-static unsigned char remote_version = 0;
18
+static unsigned char remote_version;
19
20
-static int verbose = 0;
20
+static int verbose;
21
22
static int serve_object(int fd_in, int fd_out) {
23
ssize_t size;
unpack-trees.c
+1
-1
@@ -278,7 +278,7 @@ static void unlink_entry(char *name)
278
}
279
}
280
281
-static volatile sig_atomic_t progress_update = 0;
281
+static volatile sig_atomic_t progress_update;
282
283
static void progress_interval(int signum)
284
{
upload-pack.c
+4
-4
@@ -14,12 +14,12 @@ static const char upload_pack_usage[] = "git-upload-pack [--strict] [--timeout=n
14
#define THEY_HAVE (1U << 0)
15
#define OUR_REF (1U << 1)
16
#define WANTED (1U << 2)
17
-static int multi_ack = 0, nr_our_refs = 0;
18
-static int use_thin_pack = 0;
17
+static int multi_ack, nr_our_refs;
18
+static int use_thin_pack;
19
static struct object_array have_obj;
20
static struct object_array want_obj;
21
-static unsigned int timeout = 0;
22
-static int use_sideband = 0;
21
+static unsigned int timeout;
22
+static int use_sideband;
23
24
static void reset_timeout(void)
25
{