summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2928390)
raw | patch | inline | side by side (parent: 2928390)
author | Junio C Hamano <junkio@cox.net> | |
Tue, 21 Mar 2006 23:49:05 +0000 (15:49 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 21 Mar 2006 23:50:18 +0000 (15:50 -0800) |
If you write code after declarations in a block, gcc scolds you
with "warning: ISO C90 forbids mixed declarations and code".
Signed-off-by: Junio C Hamano <junkio@cox.net>
with "warning: ISO C90 forbids mixed declarations and code".
Signed-off-by: Junio C Hamano <junkio@cox.net>
http-push.c | patch | blob | history |
diff --git a/http-push.c b/http-push.c
index b35d400ee1a2e8b5c97ca6ad82f6d91818519456..21c5289cde14d1a91c691f263c35c498d7beeaea 100644 (file)
--- a/http-push.c
+++ b/http-push.c
struct ref *ref;
unsigned char remote_sha1[20];
struct object *obj;
+ int len = strlen(refname) + 1;
if (fetch_ref(refname, remote_sha1) != 0) {
fprintf(stderr,
}
}
- int len = strlen(refname) + 1;
ref = xcalloc(1, sizeof(*ref) + len);
memcpy(ref->old_sha1, remote_sha1, 20);
memcpy(ref->name, refname, len);
int objects_to_send;
int rc = 0;
int i;
+ int new_refs;
+ struct ref *ref;
setup_git_directory();
setup_ident();
}
}
if (!remote->url) {
- remote->url = arg;
char *path = strstr(arg, "//");
+ remote->url = arg;
if (path) {
path = index(path+2, '/');
if (path)
return 0;
}
- int new_refs = 0;
- struct ref *ref;
+ new_refs = 0;
for (ref = remote_refs; ref; ref = ref->next) {
char old_hex[60], *new_hex;
+ const char *commit_argv[4];
+ int commit_argc;
+ char *new_sha1_hex, *old_sha1_hex;
+
if (!ref->peer_ref)
continue;
if (!memcmp(ref->old_sha1, ref->peer_ref->new_sha1, 20)) {
}
/* Set up revision info for this refspec */
- const char *commit_argv[4];
- int commit_argc = 3;
- char *new_sha1_hex = strdup(sha1_to_hex(ref->new_sha1));
- char *old_sha1_hex = NULL;
+ commit_argc = 3;
+ new_sha1_hex = strdup(sha1_to_hex(ref->new_sha1));
+ old_sha1_hex = NULL;
commit_argv[1] = "--objects";
commit_argv[2] = new_sha1_hex;
if (!push_all && !is_zero_sha1(ref->old_sha1)) {