diff --git a/builtin-push.c b/builtin-push.c
index c45649e26cf5284323aa80a5fe73b5842346eb14..979efcc45fca1a39b125e02d14b1f5d096f813ba 100644 (file)
--- a/builtin-push.c
+++ b/builtin-push.c
/* Ignore the "refs/" at the beginning of the refname */
ref += 5;
/* Ignore the "refs/" at the beginning of the refname */
ref += 5;
- if (!strncmp(ref, "tags/", 5))
+ if (!prefixcmp(ref, "tags/"))
add_refspec(xstrdup(ref));
return 0;
}
add_refspec(xstrdup(ref));
return 0;
}
int is_refspec;
char *s, *p;
int is_refspec;
char *s, *p;
- if (!strncmp("URL:", buffer, 4)) {
+ if (!prefixcmp(buffer, "URL:")) {
is_refspec = 0;
s = buffer + 4;
is_refspec = 0;
s = buffer + 4;
- } else if (!strncmp("Push:", buffer, 5)) {
+ } else if (!prefixcmp(buffer, "Push:")) {
is_refspec = 1;
s = buffer + 5;
} else
is_refspec = 1;
s = buffer + 5;
} else
static int get_remote_config(const char* key, const char* value)
{
static int get_remote_config(const char* key, const char* value)
{
- if (!strncmp(key, "remote.", 7) &&
+ if (!prefixcmp(key, "remote.") &&
!strncmp(key + 7, config_repo, config_repo_len)) {
if (!strcmp(key + 7 + config_repo_len, ".url")) {
if (config_current_uri < MAX_URI)
!strncmp(key + 7, config_repo, config_repo_len)) {
if (!strcmp(key + 7 + config_repo_len, ".url")) {
if (config_current_uri < MAX_URI)
const char **dest_refspec = refspec;
const char *dest = uri[i];
const char *sender = "git-send-pack";
const char **dest_refspec = refspec;
const char *dest = uri[i];
const char *sender = "git-send-pack";
- if (!strncmp(dest, "http://", 7) ||
- !strncmp(dest, "https://", 8))
+ if (!prefixcmp(dest, "http://") ||
+ !prefixcmp(dest, "https://"))
sender = "git-http-push";
else if (thin)
argv[dest_argc++] = "--thin";
sender = "git-http-push";
else if (thin)
argv[dest_argc++] = "--thin";
verbose=1;
continue;
}
verbose=1;
continue;
}
- if (!strncmp(arg, "--repo=", 7)) {
+ if (!prefixcmp(arg, "--repo=")) {
repo = arg+7;
continue;
}
repo = arg+7;
continue;
}
thin = 0;
continue;
}
thin = 0;
continue;
}
- if (!strncmp(arg, "--receive-pack=", 15)) {
+ if (!prefixcmp(arg, "--receive-pack=")) {
receivepack = arg;
continue;
}
receivepack = arg;
continue;
}
- if (!strncmp(arg, "--exec=", 7)) {
+ if (!prefixcmp(arg, "--exec=")) {
receivepack = arg;
continue;
}
receivepack = arg;
continue;
}