summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 554555a)
raw | patch | inline | side by side (parent: 554555a)
author | Brian Gianforcaro <b.gianfo@gmail.com> | |
Tue, 1 Sep 2009 05:35:10 +0000 (01:35 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 1 Sep 2009 06:26:28 +0000 (23:26 -0700) |
The majority of code in core git appears to use a single
space after if/for/while. This is an attempt to bring more
code to this standard. These are entirely cosmetic changes.
Signed-off-by: Brian Gianforcaro <b.gianfo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
space after if/for/while. This is an attempt to bring more
code to this standard. These are entirely cosmetic changes.
Signed-off-by: Brian Gianforcaro <b.gianfo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 files changed:
builtin-blame.c | patch | blob | history | |
builtin-clone.c | patch | blob | history | |
builtin-for-each-ref.c | patch | blob | history | |
builtin-pack-objects.c | patch | blob | history | |
builtin-remote.c | patch | blob | history | |
builtin-shortlog.c | patch | blob | history | |
connect.c | patch | blob | history | |
diff.c | patch | blob | history | |
pack-redundant.c | patch | blob | history | |
remote.c | patch | blob | history | |
upload-pack.c | patch | blob | history | |
var.c | patch | blob | history | |
wt-status.c | patch | blob | history |
diff --git a/builtin-blame.c b/builtin-blame.c
index fd6ca51eebb2234be429b47b572ae2f30592ff4e..7512773b401255e76aadd5be6e561432d7d60772 100644 (file)
--- a/builtin-blame.c
+++ b/builtin-blame.c
/*
* Now, convert both name and e-mail using mailmap
*/
- if(map_user(&mailmap, mail+1, mail_len-1, person, tmp-person-1)) {
+ if (map_user(&mailmap, mail+1, mail_len-1, person, tmp-person-1)) {
/* Add a trailing '>' to email, since map_user returns plain emails
Note: It already has '<', since we replace from mail+1 */
mailpos = memchr(mail, '\0', mail_len);
diff --git a/builtin-clone.c b/builtin-clone.c
index 0d2b4a8200ec10b2f6972cc3b7ddbb7a5b833b54..991a7ae92f21e241eeba535ad48bb27d2398f962 100644 (file)
--- a/builtin-clone.c
+++ b/builtin-clone.c
option_upload_pack);
refs = transport_get_remote_refs(transport);
- if(refs)
+ if (refs)
transport_fetch_refs(transport, refs);
}
diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c
index d7cc8cafbfb4ea39e347828013b28d21cfe2be74..a5a83f14693b94adf3ae0dbc1b500b2e6b2be54d 100644 (file)
--- a/builtin-for-each-ref.c
+++ b/builtin-for-each-ref.c
if (!prefixcmp(name, "refname"))
refname = ref->refname;
- else if(!prefixcmp(name, "upstream")) {
+ else if (!prefixcmp(name, "upstream")) {
struct branch *branch;
/* only local branches may have an upstream */
if (prefixcmp(ref->refname, "refs/heads/"))
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index c4337480fd3ebbe86919b3014316143ecfa0ccaf..c918d4bfc4859e19ec7000e21f8b9380c305a8b9 100644 (file)
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
static int git_pack_config(const char *k, const char *v, void *cb)
{
- if(!strcmp(k, "pack.window")) {
+ if (!strcmp(k, "pack.window")) {
window = git_config_int(k, v);
return 0;
}
diff --git a/builtin-remote.c b/builtin-remote.c
index 008abfe0922f6d1662aebcfbf63ba9f47de4ae65..0777dd719b41ec4c545b336bc5144a73d34001d7 100644 (file)
--- a/builtin-remote.c
+++ b/builtin-remote.c
@@ -385,7 +385,7 @@ static int get_head_names(const struct ref *remote_refs, struct ref_states *stat
get_fetch_map(remote_refs, &refspec, &fetch_map_tail, 0);
matches = guess_remote_head(find_ref_by_name(remote_refs, "HEAD"),
fetch_map, 1);
- for(ref = matches; ref; ref = ref->next)
+ for (ref = matches; ref; ref = ref->next)
string_list_append(abbrev_branch(ref->name), &states->heads);
free_refs(fetch_map);
const char *symref;
strbuf_addf(&buf, "refs/remotes/%s", rename->old);
- if(!prefixcmp(refname, buf.buf)) {
+ if (!prefixcmp(refname, buf.buf)) {
item = string_list_append(xstrdup(refname), rename->remote_branches);
symref = resolve_ref(refname, orig_sha1, 1, &flag);
if (flag & REF_ISSYMREF)
diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index 6a3812ee18a2ca1bc251f67582ebaee3675d9af5..4d4a3c82d6209ce3ec897dad0c69d58a329b4303 100644 (file)
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
/* copy author name to namebuf, to support matching on both name and email */
memcpy(namebuf, author, boemail - author);
len = boemail - author;
- while(len > 0 && isspace(namebuf[len-1]))
+ while (len > 0 && isspace(namebuf[len-1]))
len--;
namebuf[len] = 0;
diff --git a/connect.c b/connect.c
index 76e542776abff8d07e7250ecfc8c7ae813302b2d..7945e38ac1c99c09f7975ae99767bc9747ac3740 100644 (file)
--- a/connect.c
+++ b/connect.c
signal(SIGCHLD, SIG_DFL);
host = strstr(url, "://");
- if(host) {
+ if (host) {
*host = '\0';
protocol = get_protocol(url);
host += 3;
index cd35e0c2d7e29012e24cc8f5f49d9d351420b56e..e1be189742f3239de028393ceabf7c6539bb0440 100644 (file)
--- a/diff.c
+++ b/diff.c
num = 0;
scale = 1;
dot = 0;
- for(;;) {
+ for (;;) {
ch = *cp;
if ( !dot && ch == '.' ) {
scale = 1;
diff --git a/pack-redundant.c b/pack-redundant.c
index 48a12bc1352ad53fbc19ec8c5982a91673a098e1..69a7ab2e27d39ecabca5c0cc25c4e372caafb46c 100644 (file)
--- a/pack-redundant.c
+++ b/pack-redundant.c
} else {
int i = 1;
new = xmalloc(sizeof(struct llist_item) * BLKSIZE);
- for(;i < BLKSIZE; i++) {
+ for (; i < BLKSIZE; i++)
llist_item_put(&new[i]);
- }
}
return new;
}
static void llist_free(struct llist *list)
{
- while((list->back = list->front)) {
+ while ((list->back = list->front)) {
list->front = list->front->next;
llist_item_put(list->back);
}
if (cmp > 0) { /* we insert before this entry */
return llist_insert(list, prev, sha1);
}
- if(!cmp) { /* already exists */
+ if (!cmp) { /* already exists */
return l;
}
prev = l;
int cmp = hashcmp(l->sha1, sha1);
if (cmp > 0) /* not in list, since sorted */
return prev;
- if(!cmp) { /* found */
+ if (!cmp) { /* found */
if (prev == NULL) {
if (hint != NULL && hint != list->front) {
/* we don't know the previous element */
static inline size_t pack_list_size(struct pack_list *pl)
{
size_t ret = 0;
- while(pl) {
+ while (pl) {
ret++;
pl = pl->next;
}
return 0;
while ((subset = pl->next)) {
- while(subset) {
+ while (subset) {
ret += sizeof_union(pl->pack, subset->pack);
subset = subset->next;
}
pl = local_packs;
while (pl) {
- if(pl->unique_objects->size)
+ if (pl->unique_objects->size)
pack_list_insert(&unique, pl);
else
pack_list_insert(&non_unique, pl);
*min = min_perm;
/* add the unique packs to the list */
pl = unique;
- while(pl) {
+ while (pl) {
pack_list_insert(min, pl);
pl = pl->next;
}
struct pack_list *subset, *pl = local_packs;
while ((subset = pl)) {
- while((subset = subset->next))
+ while ((subset = subset->next))
cmp_two_packs(pl, subset);
pl = pl->next;
}
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
- if(!strcmp(arg, "--")) {
+ if (!strcmp(arg, "--")) {
i++;
break;
}
- if(!strcmp(arg, "--all")) {
+ if (!strcmp(arg, "--all")) {
load_all_packs = 1;
continue;
}
- if(!strcmp(arg, "--verbose")) {
+ if (!strcmp(arg, "--verbose")) {
verbose = 1;
continue;
}
- if(!strcmp(arg, "--alt-odb")) {
+ if (!strcmp(arg, "--alt-odb")) {
alt_odb = 1;
continue;
}
- if(*arg == '-')
+ if (*arg == '-')
usage(pack_redundant_usage);
else
break;
diff --git a/remote.c b/remote.c
index c3ada2d72b9b3f7411ffe420030768e73a003923..4b5b90597999cb836979338d84d1c5d4748c96e7 100644 (file)
--- a/remote.c
+++ b/remote.c
case 0:
if (!memcmp(dst_value, "refs/", 5))
matched_dst = make_linked_ref(dst_value, dst_tail);
- else if((dst_guess = guess_ref(dst_value, matched_src)))
+ else if ((dst_guess = guess_ref(dst_value, matched_src)))
matched_dst = make_linked_ref(dst_guess, dst_tail);
else
error("unable to push to unqualified destination: %s\n"
diff --git a/upload-pack.c b/upload-pack.c
index 4d8be834ff45ba869bb84f0fa8a424a3c469a200..dacbc7614b1dc4735ca73ed067aec31463f147d0 100644 (file)
--- a/upload-pack.c
+++ b/upload-pack.c
save_commit_buffer = 0;
- for(;;) {
+ for (;;) {
int len = packet_read_line(0, line, sizeof(line));
reset_timeout();
index 7362ed87354a4bea98c28f9a8c315b7209c67fa2..125c0d1676abae6de29de14061d1a24fd842712d 100644 (file)
--- a/var.c
+++ b/var.c
static void list_vars(void)
{
struct git_var *ptr;
- for(ptr = git_vars; ptr->read; ptr++) {
+ for (ptr = git_vars; ptr->read; ptr++)
printf("%s=%s\n", ptr->name, ptr->read(IDENT_WARN_ON_NO_NAME));
- }
}
static const char *read_var(const char *var)
struct git_var *ptr;
const char *val;
val = NULL;
- for(ptr = git_vars; ptr->read; ptr++) {
+ for (ptr = git_vars; ptr->read; ptr++) {
if (strcmp(var, ptr->name) == 0) {
val = ptr->read(IDENT_ERROR_ON_NO_NAME);
break;
diff --git a/wt-status.c b/wt-status.c
index 63598ce40cdad4bc9acc5446d304f0512341f973..33954564c6e359c98d1a91f50d91e2893ccf9550 100644 (file)
--- a/wt-status.c
+++ b/wt-status.c
setup_standard_excludes(&dir);
fill_directory(&dir, NULL);
- for(i = 0; i < dir.nr; i++) {
+ for (i = 0; i < dir.nr; i++) {
struct dir_entry *ent = dir.entries[i];
if (!cache_name_is_other(ent->name, ent->len))
continue;