for (i = 1; i < argc; i++) {
const char *arg = argv[i];
- if (!(-prefixcmp(arg, "--exec="))) {
+ if (!prefixcmp(arg, "--exec=")) {
if (exec_at)
die("multiple --exec specified");
exec = arg + 7;
output_option |= OUTPUT_LONG_OBJECT_NAME;
else if (!strcmp("-S", arg) && ++i < argc)
revs_file = argv[i];
- else if (!(-prefixcmp(arg, "-M"))) {
+ else if (!prefixcmp(arg, "-M")) {
opt |= PICKAXE_BLAME_MOVE;
blame_move_score = parse_score(arg+2);
}
- else if (!(-prefixcmp(arg, "-C"))) {
+ else if (!prefixcmp(arg, "-C")) {
if (opt & PICKAXE_BLAME_COPY)
opt |= PICKAXE_BLAME_COPY_HARDER;
opt |= PICKAXE_BLAME_COPY | PICKAXE_BLAME_MOVE;
blame_copy_score = parse_score(arg+2);
}
- else if (!(-prefixcmp(arg, "-L"))) {
+ else if (!prefixcmp(arg, "-L")) {
if (!arg[2]) {
if (++i >= argc)
usage(blame_usage);
opt.word_regexp = 1;
continue;
}
- if (!(-prefixcmp(arg, "-A")) ||
- !(-prefixcmp(arg, "-B")) ||
- !(-prefixcmp(arg, "-C")) ||
+ if (!prefixcmp(arg, "-A") ||
+ !prefixcmp(arg, "-B") ||
+ !prefixcmp(arg, "-C") ||
(arg[0] == '-' && '1' <= arg[1] && arg[1] <= '9')) {
unsigned num;
const char *scan;
incremental = 1;
continue;
}
- if (!(-prefixcmp(arg, "--window="))) {
+ if (!prefixcmp(arg, "--window=")) {
char *end;
window = strtoul(arg+9, &end, 0);
if (!arg[9] || *end)
usage(pack_usage);
continue;
}
- if (!(-prefixcmp(arg, "--depth="))) {
+ if (!prefixcmp(arg, "--depth=")) {
char *end;
depth = strtoul(arg+8, &end, 0);
if (!arg[8] || *end)
continue;
}
if (!strcmp("--unpacked", arg) ||
- !(-prefixcmp(arg, "--unpacked=")) ||
+ !prefixcmp(arg, "--unpacked=") ||
!strcmp("--reflog", arg) ||
!strcmp("--all", arg)) {
use_internal_rev_list = 1;
int is_refspec;
char *s, *p;
- if (!(-prefixcmp(buffer, "URL:"))) {
+ if (!prefixcmp(buffer, "URL:")) {
is_refspec = 0;
s = buffer + 4;
- } else if (!(-prefixcmp(buffer, "Push:"))) {
+ } else if (!prefixcmp(buffer, "Push:")) {
is_refspec = 1;
s = buffer + 5;
} else
SHA1_Init(&ctx);
while (fgets(buf, sizeof(buf), f)) {
- if (!(-prefixcmp(buf, "<<<<<<< ")))
+ if (!prefixcmp(buf, "<<<<<<< "))
hunk = 1;
- else if (!(-prefixcmp(buf, "=======")))
+ else if (!prefixcmp(buf, "======="))
hunk = 2;
- else if (!(-prefixcmp(buf, ">>>>>>> "))) {
+ else if (!prefixcmp(buf, ">>>>>>> ")) {
hunk_no++;
hunk = 0;
if (memcmp(one->ptr, two->ptr, one->nr < two->nr ?
return 0;
if (fnmatch(match_ref_pattern, tail, 0))
return 0;
- if (!(-prefixcmp(refname, "refs/heads/")))
+ if (!prefixcmp(refname, "refs/heads/"))
return append_head_ref(refname, sha1, flag, cb_data);
- if (!(-prefixcmp(refname, "refs/tags/")))
+ if (!prefixcmp(refname, "refs/tags/"))
return append_tag_ref(refname, sha1, flag, cb_data);
return append_ref(refname, sha1, 0);
}
nargv[nargc++] = "git-archive";
nargv[nargc++] = "--format=tar";
- if (2 <= argc && !(-prefixcmp(argv[1], "--remote="))) {
+ if (2 <= argc && !prefixcmp(argv[1], "--remote=")) {
nargv[nargc++] = argv[1];
argv++;
argc--;
for (i = 0; i < ARRAY_SIZE(daemon_service); i++) {
struct daemon_service *s = &(daemon_service[i]);
int namelen = strlen(s->name);
- if (!(-prefixcmp(line, "git-")) &&
+ if (!prefixcmp(line, "git-") &&
!strncmp(s->name, line + 4, namelen) &&
line[namelen + 4] == ' ') {
/*
static void cmd_mark(void)
{
- if (!(-prefixcmp(command_buf.buf, "mark :"))) {
+ if (!prefixcmp(command_buf.buf, "mark :")) {
next_mark = strtoumax(command_buf.buf + 6, NULL, 10);
read_next_command();
}
size_t length;
char *buffer;
- if ((-prefixcmp(command_buf.buf, "data ")))
+ if (prefixcmp(command_buf.buf, "data "))
die("Expected 'data n' command, found: %s", command_buf.buf);
- if (!(-prefixcmp(command_buf.buf + 5, "<<"))) {
+ if (!prefixcmp(command_buf.buf + 5, "<<")) {
char *term = xstrdup(command_buf.buf + 5 + 2);
size_t sz = 8192, term_len = command_buf.len - 5 - 2;
length = 0;
oe = find_mark(strtoumax(p + 1, &x, 10));
hashcpy(sha1, oe->sha1);
p = x;
- } else if (!(-prefixcmp(p, "inline"))) {
+ } else if (!prefixcmp(p, "inline")) {
inline_data = 1;
p += 6;
} else {
const char *from;
struct branch *s;
- if ((-prefixcmp(command_buf.buf, "from ")))
+ if (prefixcmp(command_buf.buf, "from "))
return;
if (b->branch_tree.tree) {
struct branch *s;
*count = 0;
- while (!(-prefixcmp(command_buf.buf, "merge "))) {
+ while (!prefixcmp(command_buf.buf, "merge ")) {
from = strchr(command_buf.buf, ' ') + 1;
n = xmalloc(sizeof(*n));
s = lookup_branch(from);
read_next_command();
cmd_mark();
- if (!(-prefixcmp(command_buf.buf, "author "))) {
+ if (!prefixcmp(command_buf.buf, "author ")) {
author = parse_ident(command_buf.buf + 7);
read_next_command();
}
- if (!(-prefixcmp(command_buf.buf, "committer "))) {
+ if (!prefixcmp(command_buf.buf, "committer ")) {
committer = parse_ident(command_buf.buf + 10);
read_next_command();
}
for (;;) {
if (1 == command_buf.len)
break;
- else if (!(-prefixcmp(command_buf.buf, "M ")))
+ else if (!prefixcmp(command_buf.buf, "M "))
file_change_m(b);
- else if (!(-prefixcmp(command_buf.buf, "D ")))
+ else if (!prefixcmp(command_buf.buf, "D "))
file_change_d(b);
else if (!strcmp("deleteall", command_buf.buf))
file_change_deleteall(b);
read_next_command();
/* from ... */
- if ((-prefixcmp(command_buf.buf, "from ")))
+ if (prefixcmp(command_buf.buf, "from "))
die("Expected from command, got %s", command_buf.buf);
from = strchr(command_buf.buf, ' ') + 1;
s = lookup_branch(from);
read_next_command();
/* tagger ... */
- if ((-prefixcmp(command_buf.buf, "tagger ")))
+ if (prefixcmp(command_buf.buf, "tagger "))
die("Expected tagger command, got %s", command_buf.buf);
tagger = parse_ident(command_buf.buf + 7);
break;
else if (!strcmp("blob", command_buf.buf))
cmd_new_blob();
- else if (!(-prefixcmp(command_buf.buf, "commit ")))
+ else if (!prefixcmp(command_buf.buf, "commit "))
cmd_new_commit();
- else if (!(-prefixcmp(command_buf.buf, "tag ")))
+ else if (!prefixcmp(command_buf.buf, "tag "))
cmd_new_tag();
- else if (!(-prefixcmp(command_buf.buf, "reset ")))
+ else if (!prefixcmp(command_buf.buf, "reset "))
cmd_reset_branch();
else if (!strcmp("checkpoint", command_buf.buf))
cmd_checkpoint();
int len;
while ((len = packet_read_line(fd[0], line, sizeof(line)))) {
- if (!(-prefixcmp(line, "shallow "))) {
+ if (!prefixcmp(line, "shallow ")) {
if (get_sha1_hex(line + 8, sha1))
die("invalid shallow line: %s", line);
register_shallow(sha1);
continue;
}
- if (!(-prefixcmp(line, "unshallow "))) {
+ if (!prefixcmp(line, "unshallow ")) {
if (get_sha1_hex(line + 10, sha1))
die("invalid unshallow line: %s", line);
if (!lookup_object(sha1))
char *arg = argv[i];
if (*arg == '-') {
- if (!(-prefixcmp(arg, "--upload-pack="))) {
+ if (!prefixcmp(arg, "--upload-pack=")) {
uploadpack = arg + 14;
continue;
}
- if (!(-prefixcmp(arg, "--exec="))) {
+ if (!prefixcmp(arg, "--exec=")) {
uploadpack = arg + 7;
continue;
}
verbose = 1;
continue;
}
- if (!(-prefixcmp(arg, "--depth="))) {
+ if (!prefixcmp(arg, "--depth=")) {
depth = strtol(arg + 8, NULL, 0);
if (stat(git_path("shallow"), &st))
st.st_mtime = 0;
char *arg = argv[i];
if (*arg == '-') {
- if (!(-prefixcmp(arg, "--upload-pack="))) {
+ if (!prefixcmp(arg, "--upload-pack=")) {
uploadpack = arg + 14;
continue;
}
- if (!(-prefixcmp(arg, "--exec="))) {
+ if (!prefixcmp(arg, "--exec=")) {
uploadpack = arg + 7;
continue;
}
if (!len)
break;
- if (!(-prefixcmp(line, "shallow "))) {
+ if (!prefixcmp(line, "shallow ")) {
unsigned char sha1[20];
struct object *object;
use_thin_pack = 0;
add_object_array(object, NULL, &shallows);
continue;
}
- if (!(-prefixcmp(line, "deepen "))) {
+ if (!prefixcmp(line, "deepen ")) {
char *end;
use_thin_pack = 0;
depth = strtol(line + 7, &end, 0);
die("Invalid deepen: %s", line);
continue;
}
- if ((-prefixcmp(line, "want ")) ||
+ if (prefixcmp(line, "want ") ||
get_sha1_hex(line+5, sha1_buf))
die("git-upload-pack: protocol error, "
"expected to get sha, not '%s'", line);