summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c9c3470)
raw | patch | inline | side by side (parent: c9c3470)
author | David Rientjes <rientjes@google.com> | |
Tue, 15 Aug 2006 17:23:48 +0000 (10:23 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 16 Aug 2006 04:22:20 +0000 (21:22 -0700) |
[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>
so the result needs to be checked.]
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
42 files changed:
index 54a43d5c54b86b474444b4440604b0df7ac61116..c253b9ca45cf7d860052ddae95bc1ed34974ffb8 100644 (file)
--- a/blame.c
+++ b/blame.c
static void get_blob(struct commit *commit);
/* Only used for statistics */
-static int num_get_patch = 0;
-static int num_commits = 0;
-static int patch_time = 0;
+static int num_get_patch;
+static int num_commits;
+static int patch_time;
struct blame_diff_state {
struct xdiff_emit_state xm;
diff --git a/builtin-apply.c b/builtin-apply.c
index 1c1d16f756d9b4b6586ca531efb2da6753f04f9a..4f0eef0ac3c2d20475b0b50e81f4d51cd4f95396 100644 (file)
--- a/builtin-apply.c
+++ b/builtin-apply.c
static int newfd = -1;
static int p_value = 1;
-static int allow_binary_replacement = 0;
-static int check_index = 0;
-static int write_index = 0;
-static int cached = 0;
-static int diffstat = 0;
-static int numstat = 0;
-static int summary = 0;
-static int check = 0;
+static int allow_binary_replacement;
+static int check_index;
+static int write_index;
+static int cached;
+static int diffstat;
+static int numstat;
+static int summary;
+static int check;
static int apply = 1;
-static int apply_in_reverse = 0;
-static int no_add = 0;
-static int show_index_info = 0;
+static int apply_in_reverse;
+static int no_add;
+static int show_index_info;
static int line_termination = '\n';
static unsigned long p_context = -1;
static const char apply_usage[] =
error_on_whitespace,
strip_whitespace,
} new_whitespace = warn_on_whitespace;
-static int whitespace_error = 0;
+static int whitespace_error;
static int squelch_whitespace_errors = 5;
-static int applied_after_stripping = 0;
-static const char *patch_input_file = NULL;
+static int applied_after_stripping;
+static const char *patch_input_file;
static void parse_whitespace_option(const char *option)
{
index 485ede7cad65f7fd69e2dbaff6b32b8ad3051c54..28b5dfd054ea8277379d6913b1f1c4cde225e70d 100644 (file)
--- a/builtin-fmt-merge-msg.c
+++ b/builtin-fmt-merge-msg.c
static const char *fmt_merge_msg_usage =
"git-fmt-merge-msg [--summary] [--no-summary] [--file <file>]";
-static int merge_summary = 0;
+static int merge_summary;
static int fmt_merge_msg_config(const char *key, const char *value)
{
diff --git a/builtin-ls-files.c b/builtin-ls-files.c
index 11386c432b7722301223b5a85a2cfe847bad5549..ad8c41e7310032c7a868ecb6a87e542af799c361 100644 (file)
--- a/builtin-ls-files.c
+++ b/builtin-ls-files.c
#include "dir.h"
#include "builtin.h"
-static int abbrev = 0;
-static int show_deleted = 0;
-static int show_cached = 0;
-static int show_others = 0;
-static int show_stage = 0;
-static int show_unmerged = 0;
-static int show_modified = 0;
-static int show_killed = 0;
-static int show_valid_bit = 0;
+static int abbrev;
+static int show_deleted;
+static int show_cached;
+static int show_others;
+static int show_stage;
+static int show_unmerged;
+static int show_modified;
+static int show_killed;
+static int show_valid_bit;
static int line_terminator = '\n';
-static int prefix_len = 0, prefix_offset = 0;
-static const char **pathspec = NULL;
-static int error_unmatch = 0;
-static char *ps_matched = NULL;
+static int prefix_len;
+static int prefix_offset;
+static const char **pathspec;
+static int error_unmatch;
+static char *ps_matched;
static const char *tag_cached = "";
static const char *tag_unmerged = "";
diff --git a/builtin-ls-tree.c b/builtin-ls-tree.c
index 261147fdbe76cf9d277bd420cc17efedecc2da2f..201defd9344a25e16066dc7d0a0a8f5707a930cb 100644 (file)
--- a/builtin-ls-tree.c
+++ b/builtin-ls-tree.c
#define LS_TREE_ONLY 2
#define LS_SHOW_TREES 4
#define LS_NAME_ONLY 8
-static int abbrev = 0;
-static int ls_options = 0;
+static int abbrev;
+static int ls_options;
static const char **pathspec;
-static int chomp_prefix = 0;
+static int chomp_prefix;
static const char *ls_tree_prefix;
static const char ls_tree_usage[] =
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index 24a4fc63b35ec4c6b5f85bda260811546b12ed46..0c65f9314501bc8c704d326ceeb1ae99bc974b28 100644 (file)
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
static FILE *cmitmsg, *patchfile, *fin, *fout;
-static int keep_subject = 0;
-static const char *metainfo_charset = NULL;
+static int keep_subject;
+static const char *metainfo_charset;
static char line[1000];
static char date[1000];
static char name[1000];
static char multipart_boundary[1000];
static int multipart_boundary_len;
-static int patch_lines = 0;
+static int patch_lines;
static char *sanity_check(char *name, char *email)
{
diff --git a/builtin-name-rev.c b/builtin-name-rev.c
index 571bba4817bfdd0e79a93780784eda940545a90f..d44e782c999eeaf59ec661047eb95544a29dc072 100644 (file)
--- a/builtin-name-rev.c
+++ b/builtin-name-rev.c
}
}
-static int tags_only = 0;
+static int tags_only;
static int name_ref(const char *path, const unsigned char *sha1)
{
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 2f9921224dfe663ebaf1f4bab2bd24df1c660999..448461bc4826da8b34ebf32c876d9b2341f51447 100644 (file)
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
*/
static unsigned char object_list_sha1[20];
-static int non_empty = 0;
-static int no_reuse_delta = 0;
-static int local = 0;
-static int incremental = 0;
+static int non_empty;
+static int no_reuse_delta;
+static int local;
+static int incremental;
static struct object_entry **sorted_by_sha, **sorted_by_type;
-static struct object_entry *objects = NULL;
-static int nr_objects = 0, nr_alloc = 0, nr_result = 0;
+static struct object_entry *objects;
+static int nr_objects, nr_alloc, nr_result;
static const char *base_name;
static unsigned char pack_file_sha1[20];
static int progress = 1;
-static volatile sig_atomic_t progress_update = 0;
+static volatile sig_atomic_t progress_update;
static int window = 10;
/*
* sorted_by_sha is also possible but this was easier to code and faster.
* This hashtable is built after all the objects are seen.
*/
-static int *object_ix = NULL;
-static int object_ix_hashsz = 0;
+static int *object_ix;
+static int object_ix_hashsz;
/*
* Pack index for existing packs give us easy access to the offsets into
struct packed_git *p;
unsigned long *revindex;
} *pack_revindex = NULL;
-static int pack_revindex_hashsz = 0;
+static int pack_revindex_hashsz;
/*
* stats
*/
-static int written = 0;
-static int written_delta = 0;
-static int reused = 0;
-static int reused_delta = 0;
+static int written;
+static int written_delta;
+static int reused;
+static int reused_delta;
static int pack_revindex_ix(struct packed_git *p)
{
diff --git a/builtin-prune.c b/builtin-prune.c
index 89ec7f1426d3f5d02486e3148b0c568edbe15300..fc885ce55bbb3a44367b8cec1ea66b1918c78f15 100644 (file)
--- a/builtin-prune.c
+++ b/builtin-prune.c
#include "cache-tree.h"
static const char prune_usage[] = "git-prune [-n]";
-static int show_only = 0;
+static int show_only;
static struct rev_info revs;
static int prune_object(char *path, const char *filename, const unsigned char *sha1)
diff --git a/builtin-push.c b/builtin-push.c
index c09ff2f65e7cf1dbcee2221b7977e51f2a3bb675..2b5e6fa9ed18c20cda264dbaf9df9d3cbac93c0e 100644 (file)
--- a/builtin-push.c
+++ b/builtin-push.c
static const char push_usage[] = "git-push [--all] [--tags] [-f | --force] <repository> [<refspec>...]";
-static int all = 0, tags = 0, force = 0, thin = 1;
-static const char *execute = NULL;
+static int all, tags, force, thin = 1;
+static const char *execute;
#define BUF_SIZE (2084)
static char buffer[BUF_SIZE];
-static const char **refspec = NULL;
-static int refspec_nr = 0;
+static const char **refspec;
+static int refspec_nr;
static void add_refspec(const char *ref)
{
diff --git a/builtin-read-tree.c b/builtin-read-tree.c
index 8da8acbb0a25f88073254e21936a6ad5c6d0cca4..53087faf7a63e6268ffff5239142a00c120dcf8f 100644 (file)
--- a/builtin-read-tree.c
+++ b/builtin-read-tree.c
#include "unpack-trees.h"
#include "builtin.h"
-static struct object_list *trees = NULL;
+static struct object_list *trees;
static int list_tree(unsigned char *sha1)
{
diff --git a/builtin-repo-config.c b/builtin-repo-config.c
index c821e22717e35795b74f1c26d16f6c7da63ebdf8..c4164802081e03c8061f77498e08dd2ca8501af7 100644 (file)
--- a/builtin-repo-config.c
+++ b/builtin-repo-config.c
static const char git_config_set_usage[] =
"git-repo-config [ --bool | --int ] [--get | --get-all | --get-regexp | --replace-all | --unset | --unset-all] name [value [value_regex]] | --list";
-static char* key = NULL;
-static regex_t* key_regexp = NULL;
-static regex_t* regexp = NULL;
-static int show_keys = 0;
-static int use_key_regexp = 0;
-static int do_all = 0;
-static int do_not_match = 0;
-static int seen = 0;
+static char *key;
+static regex_t *key_regexp;
+static regex_t *regexp;
+static int show_keys;
+static int use_key_regexp;
+static int do_all;
+static int do_not_match;
+static int seen;
static enum { T_RAW, T_INT, T_BOOL } type = T_RAW;
static int show_all_config(const char *key_, const char *value_)
diff --git a/builtin-rev-list.c b/builtin-rev-list.c
index 0dee1734a31308ace74b0b25cc87ffcf4993549b..bc48a3e23081264d06f2659181a19b31694dd993 100644 (file)
--- a/builtin-rev-list.c
+++ b/builtin-rev-list.c
static struct rev_info revs;
-static int bisect_list = 0;
-static int show_timestamp = 0;
-static int hdr_termination = 0;
+static int bisect_list;
+static int show_timestamp;
+static int hdr_termination;
static const char *header_prefix;
static void show_commit(struct commit *commit)
diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c
index aca4a3603283a257f7621934103c85d5c0c31390..fd3ccc8546455f60f56ceb59dbe98fb367a86d2a 100644 (file)
--- a/builtin-rev-parse.c
+++ b/builtin-rev-parse.c
#define DO_NONFLAGS 8
static int filter = ~0;
-static const char *def = NULL;
+static const char *def;
#define NORMAL 0
#define REVERSED 1
static int show_type = NORMAL;
-static int symbolic = 0;
-static int abbrev = 0;
-static int output_sq = 0;
+static int symbolic;
+static int abbrev;
+static int output_sq;
-static int revs_count = 0;
+static int revs_count;
/*
* Some arguments are relevant "revision" arguments,
diff --git a/builtin-show-branch.c b/builtin-show-branch.c
index 2a1b848f6c169f09cb168d12e6bb5033795b8be2..95fbf77fad84a13330b0c0e58586edac0eb037f0 100644 (file)
--- a/builtin-show-branch.c
+++ b/builtin-show-branch.c
static const char show_branch_usage[] =
"git-show-branch [--sparse] [--current] [--all] [--heads] [--tags] [--topo-order] [--more=count | --list | --independent | --merge-base ] [--topics] [<refs>...]";
-static int default_num = 0;
-static int default_alloc = 0;
-static const char **default_arg = NULL;
+static int default_num;
+static int default_alloc;
+static const char **default_arg;
#define UNINTERESTING 01
diff --git a/builtin-update-index.c b/builtin-update-index.c
index d2556f376b293d2907cd8416e99f9c0bd31781ca..9f0cf28ba2dde7c5000029107460a3f4ca873aa3 100644 (file)
--- a/builtin-update-index.c
+++ b/builtin-update-index.c
static int info_only;
static int force_remove;
static int verbose;
-static int mark_valid_only = 0;
+static int mark_valid_only;
#define MARK_VALID 1
#define UNMARK_VALID 2
diff --git a/commit.c b/commit.c
index 77f0ca175c66b0ef0b7ac5b24672b106c6f17178..972d1b70c02d0a21bbb187ef964e6604d4556e87 100644 (file)
--- a/commit.c
+++ b/commit.c
int count_parents(struct commit * commit)
{
- int count = 0;
+ int count;
struct commit_list * parents = commit->parents;
- for (count=0;parents; parents=parents->next,count++)
- ;
+ for (count = 0; parents; parents = parents->next,count++)
+ ;
return count;
}
diff --git a/connect.c b/connect.c
index b9c222085ee1390c8f0c02f63304193fa78ce677..7a6a73f2a333d067c5a5442004f76ebbb9aaed17 100644 (file)
--- a/connect.c
+++ b/connect.c
#include <netdb.h>
#include <signal.h>
-static char *server_capabilities = NULL;
+static char *server_capabilities;
static int check_ref(const char *name, int len, unsigned int flags)
{
}
-static char *git_proxy_command = NULL;
-static const char *rhost_name = NULL;
+static char *git_proxy_command;
+static const char *rhost_name;
static int rhost_len;
static int git_proxy_command_options(const char *var, const char *value)
diff --git a/daemon.c b/daemon.c
index 810837f0c4b8296ce762441c80527efdb6c9c3b6..012936f3bd76d9f9648ba9498b4126c7d6861e5c 100644 (file)
--- a/daemon.c
+++ b/daemon.c
" [--reuseaddr] [--detach] [--pid-file=file] [directory...]";
/* List of acceptable pathname prefixes */
-static char **ok_paths = NULL;
-static int strict_paths = 0;
+static char **ok_paths;
+static int strict_paths;
/* If this is set, git-daemon-export-ok is not required */
-static int export_all_trees = 0;
+static int export_all_trees;
/* Take all paths relative to this one if non-NULL */
-static char *base_path = NULL;
+static char *base_path;
/* If defined, ~user notation is allowed and the string is inserted
* after ~user/. E.g. a request to git://host/~alice/frotz would
* go to /home/alice/pub_git/frotz with --user-path=pub_git.
*/
-static const char *user_path = NULL;
+static const char *user_path;
/* Timeout, and initial timeout */
-static unsigned int timeout = 0;
-static unsigned int init_timeout = 0;
+static unsigned int timeout;
+static unsigned int init_timeout;
static void logreport(int priority, const char *err, va_list params)
{
static int max_connections = 25;
/* These are updated by the signal handler */
-static volatile unsigned int children_reaped = 0;
+static volatile unsigned int children_reaped;
static pid_t dead_child[MAX_CHILDREN];
/* These are updated by the main loop */
-static unsigned int children_spawned = 0;
-static unsigned int children_deleted = 0;
+static unsigned int children_spawned;
+static unsigned int children_deleted;
static struct child {
pid_t pid;
diff --git a/describe.c b/describe.c
index 324ca8965b9512de59b515cdcc29801022553d1d..2b9301fc1205795e30dfd7a7493cb03cdebdb437 100644 (file)
--- a/describe.c
+++ b/describe.c
static const char describe_usage[] =
"git-describe [--all] [--tags] [--abbrev=<n>] <committish>*";
-static int all = 0; /* Default to annotated tags only */
-static int tags = 0; /* But allow any tags if --tags is specified */
+static int all; /* Default to annotated tags only */
+static int tags; /* But allow any tags if --tags is specified */
static int abbrev = DEFAULT_ABBREV;
-static int names = 0, allocs = 0;
+static int names, allocs;
static struct commit_name {
const struct commit *commit;
int prio; /* annotated tag = 2, tag = 1, head = 0 */
index 6a8c0c9c0130579b4fb89e0444511357fe0c78ec..7a238d023336d4340efd67534dae4ed23dd5d3c0 100644 (file)
--- a/diff.c
+++ b/diff.c
static int use_size_cache;
-static int diff_detect_rename_default = 0;
+static int diff_detect_rename_default;
static int diff_rename_limit_default = -1;
-static int diff_use_color_default = 0;
+static int diff_use_color_default;
/* "\033[1;38;5;2xx;48;5;2xxm\0" is 23 bytes */
static char diff_colors[][24] = {
diff --git a/environment.c b/environment.c
index 87162b257254434be356b1a579967d51adff1e5f..e6bd0033b4666f52dc756b6e2b0d5a1745b0c6b9 100644 (file)
--- a/environment.c
+++ b/environment.c
char git_default_name[MAX_GITNAME];
int use_legacy_headers = 1;
int trust_executable_bit = 1;
-int assume_unchanged = 0;
-int prefer_symlink_refs = 0;
-int log_all_ref_updates = 0;
+int assume_unchanged;
+int prefer_symlink_refs;
+int log_all_ref_updates;
int warn_ambiguous_refs = 1;
-int repository_format_version = 0;
+int repository_format_version;
char git_commit_encoding[MAX_ENCODING_LENGTH] = "utf-8";
int shared_repository = PERM_UMASK;
-const char *apply_default_whitespace = NULL;
+const char *apply_default_whitespace;
int zlib_compression_level = Z_DEFAULT_COMPRESSION;
int pager_in_use;
int pager_use_color = 1;
diff --git a/exec_cmd.c b/exec_cmd.c
index 62f51fcd6e367d2dc7e3dc8d967ee05fd1648d04..e30936d72cd48822b43ec7568d5fcafc76a7659e 100644 (file)
--- a/exec_cmd.c
+++ b/exec_cmd.c
extern char **environ;
static const char *builtin_exec_path = GIT_EXEC_PATH;
-static const char *current_exec_path = NULL;
+static const char *current_exec_path;
void git_set_exec_path(const char *exec_path)
{
diff --git a/fetch-pack.c b/fetch-pack.c
index b7824dbed4e10d912a0977865e24e21ff9295aae..e18c1489a1ab8620cade351ec502828b10a41ac4 100644 (file)
--- a/fetch-pack.c
+++ b/fetch-pack.c
*/
#define MAX_IN_VAIN 256
-static struct commit_list *rev_list = NULL;
-static int non_common_revs = 0, multi_ack = 0, use_thin_pack = 0, use_sideband;
+static struct commit_list *rev_list;
+static int non_common_revs, multi_ack, use_thin_pack, use_sideband;
static void rev_list_push(struct commit *commit, int mark)
{
return retval;
}
-static struct commit_list *complete = NULL;
+static struct commit_list *complete;
static int mark_complete(const char *path, const unsigned char *sha1)
{
diff --git a/fsck-objects.c b/fsck-objects.c
index b0e882a99f91eba2e5d1eb04c3a93b03db0edadb..31e00d84b30f95c713b3dc6a654b4ef8459c6729 100644 (file)
--- a/fsck-objects.c
+++ b/fsck-objects.c
#define REACHABLE 0x0001
#define SEEN 0x0002
-static int show_root = 0;
-static int show_tags = 0;
-static int show_unreachable = 0;
-static int check_full = 0;
-static int check_strict = 0;
-static int keep_cache_objects = 0;
+static int show_root;
+static int show_tags;
+static int show_unreachable;
+static int check_full;
+static int check_strict;
+static int keep_cache_objects;
static unsigned char head_sha1[20];
#ifdef NO_D_INO_IN_DIRENT
closedir(dir);
}
-static int default_refs = 0;
+static int default_refs;
static int fsck_handle_ref(const char *refname, const unsigned char *sha1)
{
index 5da7787d867365b5a018fd3806fc5d0bfd9b92a2..930998bbe542cbaa92b3f16a6b0dc0d6ad43b874 100644 (file)
--- a/git.c
+++ b/git.c
}
static const char *alias_command;
-static char *alias_string = NULL;
+static char *alias_string;
static int git_alias_config(const char *var, const char *value)
{
index 6484cb9df2651de7430ee608ef7d14a4d3ac4c99..9ecdefdb03be7fac8d9283c93f2320f71bd062d6 100644 (file)
--- a/help.c
+++ b/help.c
static int term_columns(void)
{
char *col_string = getenv("COLUMNS");
- int n_cols = 0;
+ int n_cols;
if (col_string && (n_cols = atoi(col_string)) > 0)
return n_cols;
diff --git a/http-fetch.c b/http-fetch.c
index de5fc44e660e3eb6f52191dd0983744447a2fe46..7f07d2a967fdecb497344817700962e9e213d3dd 100644 (file)
--- a/http-fetch.c
+++ b/http-fetch.c
#define PREV_BUF_SIZE 4096
#define RANGE_HEADER_SIZE 30
-static int commits_on_stdin = 0;
+static int commits_on_stdin;
static int got_alternates = -1;
-static int corrupt_object_found = 0;
+static int corrupt_object_found;
static struct curl_slist *no_pragma_header;
struct alt_base *next;
};
-static struct alt_base *alt = NULL;
+static struct alt_base *alt;
enum object_request_state {
WAITING,
};
#endif
-static struct object_request *object_queue_head = NULL;
+static struct object_request *object_queue_head;
static size_t fwrite_sha1_file(void *ptr, size_t eltsize, size_t nmemb,
void *data)
diff --git a/http-push.c b/http-push.c
index 22a3e2bc0abbaadbe86a69dace48fd40ab575405..2bd984576523a7f2b646095eae92d08e7476b023 100644 (file)
--- a/http-push.c
+++ b/http-push.c
/* We allow "recursive" symbolic refs. Only within reason, though */
#define MAXDEPTH 5
-static int pushing = 0;
-static int aborted = 0;
+static int pushing;
+static int aborted;
static signed char remote_dir_exists[256];
static struct curl_slist *no_pragma_header;
static struct curl_slist *default_headers;
-static int push_verbosely = 0;
-static int push_all = 0;
-static int force_all = 0;
+static int push_verbosely;
+static int push_all;
+static int force_all;
-static struct object_list *objects = NULL;
+static struct object_list *objects;
struct repo
{
struct remote_lock *locks;
};
-static struct repo *remote = NULL;
+static struct repo *remote;
enum transfer_state {
NEED_FETCH,
struct transfer_request *next;
};
-static struct transfer_request *request_queue_head = NULL;
+static struct transfer_request *request_queue_head;
struct xml_ctx
{
diff --git a/local-fetch.c b/local-fetch.c
index 7d01845d392ab891c8cfe9db9a218e4c2d70e53e..7b6875cce6c5a08db06e637abc48ce8f26216db4 100644 (file)
--- a/local-fetch.c
+++ b/local-fetch.c
#include "commit.h"
#include "fetch.h"
-static int use_link = 0;
-static int use_symlink = 0;
+static int use_link;
+static int use_symlink;
static int use_filecopy = 1;
-static int commits_on_stdin = 0;
+static int commits_on_stdin;
static const char *path; /* "Remote" git repository */
{
}
-static struct packed_git *packs = NULL;
+static struct packed_git *packs;
static void setup_index(unsigned char *sha1)
{
diff --git a/merge-base.c b/merge-base.c
index 59f723f4047f831165b8d52ac13def398e663ac3..009caf804b43fdd644ff08991d55d0e417fd34d8 100644 (file)
--- a/merge-base.c
+++ b/merge-base.c
#include "cache.h"
#include "commit.h"
-static int show_all = 0;
+static int show_all;
static int merge_base(struct commit *rev1, struct commit *rev2)
{
diff --git a/merge-index.c b/merge-index.c
index a9c8cc1f93a815a9b8226394e6f035a016fedbdb..646d090c58e774bdf0f412da39f4b67fd7a696c6 100644 (file)
--- a/merge-index.c
+++ b/merge-index.c
#include "cache.h"
-static const char *pgm = NULL;
+static const char *pgm;
static const char *arguments[8];
static int one_shot, quiet;
static int err;
diff --git a/mktree.c b/mktree.c
index 9a6f0d2f6b0be1307985b4bd56d0bc84abd1df02..93241385e4aee76fc42db5849365740c474b9bdd 100644 (file)
--- a/mktree.c
+++ b/mktree.c
int i;
qsort(entries, used, sizeof(*entries), ent_compare);
- size = 100;
for (size = i = 0; i < used; i++)
size += 32 + entries[i]->len;
buffer = xmalloc(size);
diff --git a/pack-redundant.c b/pack-redundant.c
index 41fb960569e1c7ed479fb123902752c552ff1341..92a09ed36281b293a8c9002a33ab80f740949a37 100644 (file)
--- a/pack-redundant.c
+++ b/pack-redundant.c
static const char pack_redundant_usage[] =
"git-pack-redundant [ --verbose ] [ --alt-odb ] < --all | <.pack filename> ...>";
-static int load_all_packs = 0, verbose = 0, alt_odb = 0;
+static int load_all_packs, verbose, alt_odb;
struct llist_item {
struct llist_item *next;
struct pack_list *pl;
};
-static struct llist_item *free_nodes = NULL;
+static struct llist_item *free_nodes;
static inline void llist_item_put(struct llist_item *item)
{
diff --git a/read-cache.c b/read-cache.c
index b18f9f72d91946816ad2cb248341e4b45c745cba..3228ffb3001fa360dbd4f5a0907fd0b204382423 100644 (file)
--- a/read-cache.c
+++ b/read-cache.c
#define CACHE_EXT(s) ( (s[0]<<24)|(s[1]<<16)|(s[2]<<8)|(s[3]) )
#define CACHE_EXT_TREE 0x54524545 /* "TREE" */
-struct cache_entry **active_cache = NULL;
+struct cache_entry **active_cache;
static time_t index_file_timestamp;
-unsigned int active_nr = 0, active_alloc = 0, active_cache_changed = 0;
+unsigned int active_nr, active_alloc, active_cache_changed;
-struct cache_tree *active_cache_tree = NULL;
+struct cache_tree *active_cache_tree;
-int cache_errno = 0;
+int cache_errno;
-static void *cache_mmap = NULL;
-static size_t cache_mmap_size = 0;
+static void *cache_mmap;
+static size_t cache_mmap_size;
/*
* This only updates the "non-critical" parts of the directory
diff --git a/receive-pack.c b/receive-pack.c
index 93929b5371bc0b9578ee5d3cb21c8ae6ade8cd1b..81e91909b8ac88423c550a6489285b003378c5f0 100644 (file)
--- a/receive-pack.c
+++ b/receive-pack.c
static const char *unpacker[] = { "unpack-objects", NULL };
-static int report_status = 0;
+static int report_status;
static char capabilities[] = "report-status";
-static int capabilities_sent = 0;
+static int capabilities_sent;
static int show_ref(const char *path, const unsigned char *sha1)
{
char ref_name[FLEX_ARRAY]; /* more */
};
-static struct command *commands = NULL;
+static struct command *commands;
static int is_all_zeroes(const char *hex)
{
diff --git a/send-pack.c b/send-pack.c
index b7cc1a90891328912e93e1d545d9b56269661b18..43e10b0a620cc3d51d8905a9de36350ca6b67966 100644 (file)
--- a/send-pack.c
+++ b/send-pack.c
"git-send-pack [--all] [--exec=git-receive-pack] <remote> [<head>...]\n"
" --all and explicit <head> specification are mutually exclusive.";
static const char *exec = "git-receive-pack";
-static int verbose = 0;
-static int send_all = 0;
-static int force_update = 0;
-static int use_thin_pack = 0;
+static int verbose;
+static int send_all;
+static int force_update;
+static int use_thin_pack;
static int is_zero_sha1(const unsigned char *sha1)
{
diff --git a/sha1_file.c b/sha1_file.c
index 842a6f3ae86993ff877150ab92bbab7b4744b4ce..18dece46b1e248a4e52e9ead3bf172ed6ab78236 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
#endif
#endif
-const unsigned char null_sha1[20] = { 0, };
+const unsigned char null_sha1[20];
static unsigned int sha1_file_open_flag = O_NOATIME;
diff --git a/ssh-fetch.c b/ssh-fetch.c
index c7d8fa80e425695374f11746ae6592f52d8401d5..0b89df6ddae5cfdfa4259379fc801f5e28f7c403 100644 (file)
--- a/ssh-fetch.c
+++ b/ssh-fetch.c
static int fd_in;
static int fd_out;
-static unsigned char remote_version = 0;
+static unsigned char remote_version;
static unsigned char local_version = 1;
static ssize_t force_write(int fd, void *buffer, size_t length)
return ret;
}
-static int prefetches = 0;
+static int prefetches;
-static struct object_list *in_transit = NULL;
+static struct object_list *in_transit;
static struct object_list **end_of_transit = &in_transit;
void prefetch(unsigned char *sha1)
}
static char conn_buf[4096];
-static size_t conn_buf_posn = 0;
+static size_t conn_buf_posn;
int fetch(unsigned char *sha1)
{
diff --git a/ssh-upload.c b/ssh-upload.c
index 2da66618fcdd6a0f5af35c9f30554a65eb427427..20b15eab57e1c4f7c4b306010d7d12bff2308141 100644 (file)
--- a/ssh-upload.c
+++ b/ssh-upload.c
#include <string.h>
static unsigned char local_version = 1;
-static unsigned char remote_version = 0;
+static unsigned char remote_version;
-static int verbose = 0;
+static int verbose;
static int serve_object(int fd_in, int fd_out) {
ssize_t size;
diff --git a/unpack-trees.c b/unpack-trees.c
index e496d8cd31b54dd3d278499d7d85439478181ce8..43ed12484f6eb8bb828987872b2782182e579b9f 100644 (file)
--- a/unpack-trees.c
+++ b/unpack-trees.c
}
}
-static volatile sig_atomic_t progress_update = 0;
+static volatile sig_atomic_t progress_update;
static void progress_interval(int signum)
{
diff --git a/upload-pack.c b/upload-pack.c
index 27e2abe36c54fbf4ff04a70a64e1985fc4a8cbd0..fcf279843ad23b0605f3c2bc558e8d04a903554b 100644 (file)
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -14,12 +14,12 @@ static const char upload_pack_usage[] = "git-upload-pack [--strict] [--timeout=n
#define THEY_HAVE (1U << 0)
#define OUR_REF (1U << 1)
#define WANTED (1U << 2)
-static int multi_ack = 0, nr_our_refs = 0;
-static int use_thin_pack = 0;
+static int multi_ack, nr_our_refs;
+static int use_thin_pack;
static struct object_array have_obj;
static struct object_array want_obj;
-static unsigned int timeout = 0;
-static int use_sideband = 0;
+static unsigned int timeout;
+static int use_sideband;
static void reset_timeout(void)
{