for (i = 0; i < files->items.nr; i++)
if (files->selected[i])
strvec_push(&args,
- files->items.items[i].string);
+ files->items.items[i].string);
parse_pathspec(&ps_selected,
PATHSPEC_ALL_MAGIC & ~PATHSPEC_LITERAL,
PATHSPEC_LITERAL_PATH, "", args.argv);
struct strvec args = STRVEC_INIT;
strvec_pushl(&args, "git", "diff", "-p", "--cached",
- oid_to_hex(!is_initial ? &oid :
- s->r->hash_algo->empty_tree),
- "--", NULL);
+ oid_to_hex(!is_initial ? &oid :
+ s->r->hash_algo->empty_tree),
+ "--", NULL);
for (i = 0; i < files->items.nr; i++)
if (files->selected[i])
strvec_push(&args,
- files->items.items[i].string);
+ files->items.items[i].string);
res = run_command_v_opt(args.argv, 0);
strvec_clear(&args);
}
cp->git_cmd = 1;
strvec_pushf(&cp->env_array,
- INDEX_ENVIRONMENT "=%s", s->s.r->index_file);
+ INDEX_ENVIRONMENT "=%s", s->s.r->index_file);
}
static int parse_range(const char **p,
if (s->revision) {
struct object_id oid;
strvec_push(&args,
- /* could be on an unborn branch */
- !strcmp("HEAD", s->revision) &&
- get_oid("HEAD", &oid) ?
- empty_tree_oid_hex() : s->revision);
+ /* could be on an unborn branch */
+ !strcmp("HEAD", s->revision) &&
+ get_oid("HEAD", &oid) ?
+ empty_tree_oid_hex() : s->revision);
}
color_arg_index = args.argc;
/* Use `--no-color` explicitly, just in case `diff.color = always`. */
strvec_pushf(&rev_argv, bad_format, oid_to_hex(current_bad_oid));
for (i = 0; i < good_revs.nr; i++)
strvec_pushf(&rev_argv, good_format,
- oid_to_hex(good_revs.oid + i));
+ oid_to_hex(good_revs.oid + i));
strvec_push(&rev_argv, "--");
if (read_paths)
read_bisect_paths(&rev_argv);
struct strvec argv = STRVEC_INIT;
strvec_pushl(&argv, "checkout", start_head.buf,
- "--", NULL);
+ "--", NULL);
if (run_command_v_opt(argv.argv, RUN_GIT_CMD)) {
res = error(_("checking out '%s' failed."
" Try 'git bisect start "
struct process_commit_data pcd = { null_oid, oid, dst, &revs};
strvec_pushl(&args, "internal: The first arg is not parsed",
- "--objects", "--in-commit-order", "--reverse", "HEAD",
- NULL);
+ "--objects", "--in-commit-order", "--reverse", "HEAD",
+ NULL);
repo_init_revisions(the_repository, &revs, NULL);
if (setup_revisions(args.argc, args.argv, &revs, NULL) > 1)
strvec_init(&args);
strvec_pushl(&args, "name-rev",
- "--peel-tag", "--name-only", "--no-undefined",
- NULL);
+ "--peel-tag", "--name-only", "--no-undefined",
+ NULL);
if (always)
strvec_push(&args, "--always");
if (!all) {
env[0] = index_env.buf;
strvec_pushl(&update_index.args,
- "--git-dir", git_dir, "--work-tree", workdir,
- "update-index", "--really-refresh", "-q",
- "--unmerged", NULL);
+ "--git-dir", git_dir, "--work-tree", workdir,
+ "update-index", "--really-refresh", "-q",
+ "--unmerged", NULL);
update_index.no_stdin = 1;
update_index.no_stdout = 1;
update_index.no_stderr = 1;
run_command(&update_index);
strvec_pushl(&diff_files.args,
- "--git-dir", git_dir, "--work-tree", workdir,
- "diff-files", "--name-only", "-z", NULL);
+ "--git-dir", git_dir, "--work-tree", workdir,
+ "diff-files", "--name-only", "-z", NULL);
diff_files.no_stdin = 1;
diff_files.git_cmd = 1;
diff_files.use_shell = 0;
child.dir = prefix;
child.out = -1;
strvec_pushl(&child.args, "diff", "--raw", "--no-abbrev", "-z",
- NULL);
+ NULL);
for (i = 0; i < argc; i++)
strvec_push(&child.args, argv[i]);
if (start_command(&child))
}
strvec_pushl(&argv, "fetch", "--append", "--no-auto-gc",
- "--no-write-commit-graph", NULL);
+ "--no-write-commit-graph", NULL);
add_options_to_argv(&argv);
if (max_children != 1 && list->nr != 1) {
strvec_push(&prune, "--no-progress");
if (has_promisor_remote())
strvec_push(&prune,
- "--exclude-promisor-objects");
+ "--exclude-promisor-objects");
if (run_command_v_opt(prune.argv, RUN_GIT_CMD))
die(FAILED_RUN, prune.argv[0]);
}
cp.git_cmd = 1;
cp.no_stdin = 1;
strvec_pushl(&cp.args, "submodule", "update",
- "--recursive", "--rebase", NULL);
+ "--recursive", "--rebase", NULL);
argv_push_verbosity(&cp.args);
return run_command(&cp);
cp.git_cmd = 1;
cp.no_stdin = 1;
strvec_pushl(&cp.args, "submodule", "update",
- "--recursive", "--checkout", NULL);
+ "--recursive", "--checkout", NULL);
argv_push_verbosity(&cp.args);
return run_command(&cp);
return -1;
strvec_pushl(&cp.args, "merge-base", "--fork-point",
- remote_branch, curr_branch->name, NULL);
+ remote_branch, curr_branch->name, NULL);
cp.no_stdin = 1;
cp.no_stderr = 1;
cp.git_cmd = 1;
strvec_pushl(&make_script_args, "", revisions, NULL);
if (opts->restrict_revision)
strvec_pushf(&make_script_args, "^%s",
- oid_to_hex(&opts->restrict_revision->object.oid));
+ oid_to_hex(&opts->restrict_revision->object.oid));
ret = sequencer_make_script(the_repository, &todo_list.buf,
make_script_args.argc, make_script_args.argv,
format_patch.git_cmd = 1;
strvec_pushl(&format_patch.args, "format-patch", "-k", "--stdout",
- "--full-index", "--cherry-pick", "--right-only",
- "--src-prefix=a/", "--dst-prefix=b/", "--no-renames",
- "--no-cover-letter", "--pretty=mboxrd", "--topo-order",
- "--no-base", NULL);
+ "--full-index", "--cherry-pick", "--right-only",
+ "--src-prefix=a/", "--dst-prefix=b/", "--no-renames",
+ "--no-cover-letter", "--pretty=mboxrd", "--topo-order",
+ "--no-base", NULL);
if (opts->git_format_patch_opt.len)
strvec_split(&format_patch.args,
- opts->git_format_patch_opt.buf);
+ opts->git_format_patch_opt.buf);
strvec_push(&format_patch.args, revisions.buf);
if (opts->restrict_revision)
strvec_pushf(&format_patch.args, "^%s",
- oid_to_hex(&opts->restrict_revision->object.oid));
+ oid_to_hex(&opts->restrict_revision->object.oid));
status = run_command(&format_patch);
if (status) {
}
if (!is_null_oid(&push_cert_oid)) {
strvec_pushf(&proc->env_array, "GIT_PUSH_CERT=%s",
- oid_to_hex(&push_cert_oid));
+ oid_to_hex(&push_cert_oid));
strvec_pushf(&proc->env_array, "GIT_PUSH_CERT_SIGNER=%s",
- sigcheck.signer ? sigcheck.signer : "");
+ sigcheck.signer ? sigcheck.signer : "");
strvec_pushf(&proc->env_array, "GIT_PUSH_CERT_KEY=%s",
- sigcheck.key ? sigcheck.key : "");
+ sigcheck.key ? sigcheck.key : "");
strvec_pushf(&proc->env_array, "GIT_PUSH_CERT_STATUS=%c",
- sigcheck.result);
+ sigcheck.result);
if (push_cert_nonce) {
strvec_pushf(&proc->env_array,
- "GIT_PUSH_CERT_NONCE=%s",
- push_cert_nonce);
+ "GIT_PUSH_CERT_NONCE=%s",
+ push_cert_nonce);
strvec_pushf(&proc->env_array,
- "GIT_PUSH_CERT_NONCE_STATUS=%s",
- nonce_status);
+ "GIT_PUSH_CERT_NONCE_STATUS=%s",
+ nonce_status);
if (nonce_status == NONCE_SLOP)
strvec_pushf(&proc->env_array,
- "GIT_PUSH_CERT_NONCE_SLOP=%ld",
- nonce_stamp_slop);
+ "GIT_PUSH_CERT_NONCE_SLOP=%ld",
+ nonce_stamp_slop);
}
}
}
int i;
for (i = 0; i < feed_state->push_options->nr; i++)
strvec_pushf(&proc.env_array,
- "GIT_PUSH_OPTION_%d=%s", i,
- feed_state->push_options->items[i].string);
+ "GIT_PUSH_OPTION_%d=%s", i,
+ feed_state->push_options->items[i].string);
strvec_pushf(&proc.env_array, "GIT_PUSH_OPTION_COUNT=%d",
- feed_state->push_options->nr);
+ feed_state->push_options->nr);
} else
strvec_pushf(&proc.env_array, "GIT_PUSH_OPTION_COUNT");
static void push_header_arg(struct strvec *args, struct pack_header *hdr)
{
strvec_pushf(args, "--pack_header=%"PRIu32",%"PRIu32,
- ntohl(hdr->hdr_version), ntohl(hdr->hdr_entries));
+ ntohl(hdr->hdr_version), ntohl(hdr->hdr_entries));
}
static const char *unpack(int err_fd, struct shallow_info *si)
strvec_push(&child.args, "-q");
if (fsck_objects)
strvec_pushf(&child.args, "--strict%s",
- fsck_msg_types.buf);
+ fsck_msg_types.buf);
if (max_input_size)
strvec_pushf(&child.args, "--max-input-size=%"PRIuMAX,
- (uintmax_t)max_input_size);
+ (uintmax_t)max_input_size);
child.no_stdout = 1;
child.err = err_fd;
child.git_cmd = 1;
if (xgethostname(hostname, sizeof(hostname)))
xsnprintf(hostname, sizeof(hostname), "localhost");
strvec_pushf(&child.args,
- "--keep=receive-pack %"PRIuMAX" on %s",
- (uintmax_t)getpid(),
- hostname);
+ "--keep=receive-pack %"PRIuMAX" on %s",
+ (uintmax_t)getpid(),
+ hostname);
if (!quiet && err_fd)
strvec_push(&child.args, "--show-resolving-progress");
strvec_push(&child.args, "--report-end-of-input");
if (fsck_objects)
strvec_pushf(&child.args, "--strict%s",
- fsck_msg_types.buf);
+ fsck_msg_types.buf);
if (!reject_thin)
strvec_push(&child.args, "--fix-thin");
if (max_input_size)
strvec_pushf(&child.args, "--max-input-size=%"PRIuMAX,
- (uintmax_t)max_input_size);
+ (uintmax_t)max_input_size);
child.out = -1;
child.err = err_fd;
child.git_cmd = 1;
strvec_push(&cmd.args, "--honor-pack-keep");
for (i = 0; i < keep_pack_list.nr; i++)
strvec_pushf(&cmd.args, "--keep-pack=%s",
- keep_pack_list.items[i].string);
+ keep_pack_list.items[i].string);
strvec_push(&cmd.args, "--non-empty");
strvec_push(&cmd.args, "--all");
strvec_push(&cmd.args, "--reflog");
if (existing_packs.nr && delete_redundant) {
if (unpack_unreachable) {
strvec_pushf(&cmd.args,
- "--unpack-unreachable=%s",
- unpack_unreachable);
+ "--unpack-unreachable=%s",
+ unpack_unreachable);
strvec_push(&cmd.env_array, "GIT_REF_PARANOIA=1");
} else if (pack_everything & LOOSEN_UNREACHABLE) {
strvec_push(&cmd.args,
- "--unpack-unreachable");
+ "--unpack-unreachable");
} else if (keep_unreachable) {
strvec_push(&cmd.args, "--keep-unreachable");
strvec_push(&cmd.args, "--pack-loose-unreachable");
*/
cp.git_cmd = 1;
strvec_pushl(&cp.args, "diff-index", "--cached", "--name-only",
- "--diff-filter=A", NULL);
+ "--diff-filter=A", NULL);
strvec_push(&cp.args, c_tree_hex);
return pipe_command(&cp, NULL, 0, out, 0, NULL, 0);
}
strvec_push(&cp.args, "read-tree");
strvec_push(&cp.args, oid_to_hex(u_tree));
strvec_pushf(&cp.env_array, "GIT_INDEX_FILE=%s",
- stash_index_path.buf);
+ stash_index_path.buf);
if (run_command(&cp)) {
remove_path(stash_index_path.buf);
return -1;
cp.git_cmd = 1;
strvec_pushl(&cp.args, "checkout-index", "--all", NULL);
strvec_pushf(&cp.env_array, "GIT_INDEX_FILE=%s",
- stash_index_path.buf);
+ stash_index_path.buf);
res = run_command(&cp);
remove_path(stash_index_path.buf);
cp.git_cmd = 1;
cp.dir = prefix;
strvec_pushf(&cp.env_array, GIT_WORK_TREE_ENVIRONMENT"=%s",
- absolute_path(get_git_work_tree()));
+ absolute_path(get_git_work_tree()));
strvec_pushf(&cp.env_array, GIT_DIR_ENVIRONMENT"=%s",
- absolute_path(get_git_dir()));
+ absolute_path(get_git_dir()));
strvec_push(&cp.args, "status");
run_command(&cp);
}
cp_reflog.git_cmd = 1;
strvec_pushl(&cp_reflog.args, "reflog", "delete", "--updateref",
- "--rewrite", NULL);
+ "--rewrite", NULL);
strvec_push(&cp_reflog.args, info->revision.buf);
ret = run_command(&cp_reflog);
if (!ret) {
cp.git_cmd = 1;
strvec_pushl(&cp.args, "log", "--format=%gd: %gs", "-g",
- "--first-parent", "-m", NULL);
+ "--first-parent", "-m", NULL);
strvec_pushv(&cp.args, argv);
strvec_push(&cp.args, ref_stash);
strvec_push(&cp.args, "--");
cp_upd_index.git_cmd = 1;
strvec_pushl(&cp_upd_index.args, "update-index", "-z", "--add",
- "--remove", "--stdin", NULL);
+ "--remove", "--stdin", NULL);
strvec_pushf(&cp_upd_index.env_array, "GIT_INDEX_FILE=%s",
stash_index_path.buf);
cp_read_tree.git_cmd = 1;
strvec_pushl(&cp_read_tree.args, "read-tree", "HEAD", NULL);
strvec_pushf(&cp_read_tree.env_array, "GIT_INDEX_FILE=%s",
- stash_index_path.buf);
+ stash_index_path.buf);
if (run_command(&cp_read_tree)) {
ret = -1;
goto done;
cp_diff_tree.git_cmd = 1;
strvec_pushl(&cp_diff_tree.args, "diff-tree", "-p", "-U1", "HEAD",
- oid_to_hex(&info->w_tree), "--", NULL);
+ oid_to_hex(&info->w_tree), "--", NULL);
if (pipe_command(&cp_diff_tree, NULL, 0, out_patch, 0, NULL, 0)) {
ret = -1;
goto done;
cp_upd_index.git_cmd = 1;
strvec_pushl(&cp_upd_index.args, "update-index",
- "--ignore-skip-worktree-entries",
- "-z", "--add", "--remove", "--stdin", NULL);
+ "--ignore-skip-worktree-entries",
+ "-z", "--add", "--remove", "--stdin", NULL);
strvec_pushf(&cp_upd_index.env_array, "GIT_INDEX_FILE=%s",
- stash_index_path.buf);
+ stash_index_path.buf);
if (pipe_command(&cp_upd_index, diff_output.buf, diff_output.len,
NULL, 0, NULL, 0)) {
cp.git_cmd = 1;
strvec_pushl(&cp.args, "clean", "--force",
- "--quiet", "-d", NULL);
+ "--quiet", "-d", NULL);
if (include_untracked == INCLUDE_ALL_FILES)
strvec_push(&cp.args, "-x");
if (run_command(&cp)) {
cp_diff.git_cmd = 1;
strvec_pushl(&cp_diff.args, "diff-index", "-p",
- "--cached", "--binary", "HEAD", "--",
- NULL);
+ "--cached", "--binary", "HEAD", "--",
+ NULL);
add_pathspecs(&cp_diff.args, ps);
if (pipe_command(&cp_diff, NULL, 0, &out, 0, NULL, 0)) {
ret = -1;
cp_apply.git_cmd = 1;
strvec_pushl(&cp_apply.args, "apply", "--index",
- "-R", NULL);
+ "-R", NULL);
if (pipe_command(&cp_apply, out.buf, out.len, NULL, 0,
NULL, 0)) {
ret = -1;
struct child_process cp = CHILD_PROCESS_INIT;
cp.git_cmd = 1;
strvec_pushl(&cp.args, "reset", "--hard", "-q",
- "--no-recurse-submodules", NULL);
+ "--no-recurse-submodules", NULL);
if (run_command(&cp)) {
ret = -1;
goto done;
cp.git_cmd = 1;
strvec_pushl(&cp.args, "checkout", "--no-overlay",
- oid_to_hex(&info.i_tree), "--", NULL);
+ oid_to_hex(&info.i_tree), "--", NULL);
if (!ps->nr)
strvec_push(&cp.args, ":/");
else
strvec_pushf(&cp.env_array, "sm_path=%s", path);
strvec_pushf(&cp.env_array, "displaypath=%s", displaypath);
strvec_pushf(&cp.env_array, "sha1=%s",
- oid_to_hex(ce_oid));
+ oid_to_hex(ce_oid));
strvec_pushf(&cp.env_array, "toplevel=%s", toplevel);
/*
*/
sq_quote_buf(&sb, path);
strvec_pushf(&cp.args, "path=%s; %s",
- sb.buf, info->argv[0]);
+ sb.buf, info->argv[0]);
strbuf_release(&sb);
free(toplevel);
} else {
strvec_pushl(&cpr.args, "--super-prefix", NULL);
strvec_pushf(&cpr.args, "%s/", displaypath);
strvec_pushl(&cpr.args, "submodule--helper", "foreach", "--recursive",
- NULL);
+ NULL);
if (info->quiet)
strvec_push(&cpr.args, "--quiet");
strbuf_release(&buf);
strvec_pushl(&diff_files_args, "diff-files",
- "--ignore-submodules=dirty", "--quiet", "--",
- path, NULL);
+ "--ignore-submodules=dirty", "--quiet", "--",
+ path, NULL);
git_config(git_diff_basic_config, NULL);
strvec_push(&cpr.args, "--super-prefix");
strvec_pushf(&cpr.args, "%s/", displaypath);
strvec_pushl(&cpr.args, "submodule--helper", "status",
- "--recursive", NULL);
+ "--recursive", NULL);
if (flags & OPT_CACHED)
strvec_push(&cpr.args, "--cached");
cp.git_cmd = 1;
cp.dir = path;
strvec_pushl(&cp.args, "submodule--helper",
- "print-default-remote", NULL);
+ "print-default-remote", NULL);
strbuf_reset(&sb);
if (capture_command(&cp, &sb, 0))
strvec_push(&cpr.args, "--super-prefix");
strvec_pushf(&cpr.args, "%s/", displaypath);
strvec_pushl(&cpr.args, "submodule--helper", "sync",
- "--recursive", NULL);
+ "--recursive", NULL);
if (flags & OPT_QUIET)
strvec_push(&cpr.args, "--quiet");
struct child_process cp_rm = CHILD_PROCESS_INIT;
cp_rm.git_cmd = 1;
strvec_pushl(&cp_rm.args, "rm", "-qn",
- path, NULL);
+ path, NULL);
if (run_command(&cp_rm))
die(_("Submodule work tree '%s' contains local "
struct string_list_item *item;
for_each_string_list_item(item, reference)
strvec_pushl(&cp.args, "--reference",
- item->string, NULL);
+ item->string, NULL);
}
if (dissociate)
strvec_push(&cp.args, "--dissociate");
if (!is_branch)
strvec_pushl(&cp.args, "update-ref", "HEAD",
- oid_to_hex(&commit->object.oid), NULL);
+ oid_to_hex(&commit->object.oid), NULL);
else {
strvec_pushl(&cp.args, "symbolic-ref", "HEAD",
- symref.buf, NULL);
+ symref.buf, NULL);
if (opts->quiet)
strvec_push(&cp.args, "--quiet");
}
cp.argv = NULL;
cp.trace2_hook_name = "post-checkout";
strvec_pushl(&cp.args, absolute_path(hook),
- oid_to_hex(&null_oid),
- oid_to_hex(&commit->object.oid),
- "1", NULL);
+ oid_to_hex(&null_oid),
+ oid_to_hex(&commit->object.oid),
+ "1", NULL);
ret = run_command(&cp);
}
}
validate_no_submodules(wt);
strvec_pushf(&child_env, "%s=%s/.git",
- GIT_DIR_ENVIRONMENT, wt->path);
+ GIT_DIR_ENVIRONMENT, wt->path);
strvec_pushf(&child_env, "%s=%s",
- GIT_WORK_TREE_ENVIRONMENT, wt->path);
+ GIT_WORK_TREE_ENVIRONMENT, wt->path);
memset(&cp, 0, sizeof(cp));
strvec_pushl(&cp.args, "status",
- "--porcelain", "--ignore-submodules=none",
- NULL);
+ "--porcelain", "--ignore-submodules=none",
+ NULL);
cp.env = child_env.argv;
cp.git_cmd = 1;
cp.dir = wt->path;
int i;
strvec_pushl(&pack_objects.args,
- "pack-objects",
- "--stdout", "--thin", "--delta-base-offset",
- NULL);
+ "pack-objects",
+ "--stdout", "--thin", "--delta-base-offset",
+ NULL);
strvec_pushv(&pack_objects.args, pack_options->argv);
pack_objects.in = -1;
pack_objects.out = bundle_fd;
int i;
strvec_pushl(&rls.args,
- "rev-list", "--boundary", "--pretty=oneline",
- NULL);
+ "rev-list", "--boundary", "--pretty=oneline",
+ NULL);
for (i = 1; i < argc; i++)
strvec_push(&rls.args, argv[i]);
rls.out = -1;
strvec_push(args, "-o");
strvec_push(args, "SendEnv=" GIT_PROTOCOL_ENVIRONMENT);
strvec_pushf(env, GIT_PROTOCOL_ENVIRONMENT "=version=%d",
- version);
+ version);
}
if (flags & CONNECT_IPV4) {
transport_check_allowed("file");
conn->trace2_child_class = "transport/file";
if (version > 0) {
- strvec_pushf(&conn->env_array, GIT_PROTOCOL_ENVIRONMENT "=version=%d",
- version);
+ strvec_pushf(&conn->env_array,
+ GIT_PROTOCOL_ENVIRONMENT "=version=%d",
+ version);
}
}
strvec_push(&conn->args, cmd.buf);
strvec_push(&rev_list.args, "--alternate-refs");
if (opt->progress)
strvec_pushf(&rev_list.args, "--progress=%s",
- _("Checking connectivity"));
+ _("Checking connectivity"));
rev_list.git_cmd = 1;
rev_list.env = opt->env;
if (git_protocol.len > 0) {
loginfo("Extended attribute \"protocol\": %s", git_protocol.buf);
strvec_pushf(env, GIT_PROTOCOL_ENVIRONMENT "=%s",
- git_protocol.buf);
+ git_protocol.buf);
}
strbuf_release(&git_protocol);
}
inet_ntop(addr->sa_family, &sin_addr->sin_addr, buf, sizeof(buf));
strvec_pushf(&cld.env_array, "REMOTE_ADDR=%s", buf);
strvec_pushf(&cld.env_array, "REMOTE_PORT=%d",
- ntohs(sin_addr->sin_port));
+ ntohs(sin_addr->sin_port));
#ifndef NO_IPV6
} else if (addr->sa_family == AF_INET6) {
char buf[128] = "";
inet_ntop(AF_INET6, &sin6_addr->sin6_addr, buf, sizeof(buf));
strvec_pushf(&cld.env_array, "REMOTE_ADDR=[%s]", buf);
strvec_pushf(&cld.env_array, "REMOTE_PORT=%d",
- ntohs(sin6_addr->sin6_port));
+ ntohs(sin6_addr->sin6_port));
#endif
}
if (xgethostname(hostname, sizeof(hostname)))
xsnprintf(hostname, sizeof(hostname), "localhost");
strvec_pushf(&cmd.args,
- "--keep=fetch-pack %"PRIuMAX " on %s",
- (uintmax_t)getpid(), hostname);
+ "--keep=fetch-pack %"PRIuMAX " on %s",
+ (uintmax_t)getpid(), hostname);
}
if (only_packfile && args->check_self_contained_and_connected)
strvec_push(&cmd.args, "--check-self-contained-and-connected");
if (pass_header)
strvec_pushf(&cmd.args, "--pack_header=%"PRIu32",%"PRIu32,
- ntohl(header.hdr_version),
+ ntohl(header.hdr_version),
ntohl(header.hdr_entries));
if (fetch_fsck_objects >= 0
? fetch_fsck_objects
strvec_push(&cmd.args, "--fsck-objects");
else
strvec_pushf(&cmd.args, "--strict%s",
- fsck_msg_types.buf);
+ fsck_msg_types.buf);
}
cmd.in = demux.out;
strvec_push(&cmd.args, "http-fetch");
strvec_pushf(&cmd.args, "--packfile=%.*s",
- (int) the_hash_algo->hexsz,
- packfile_uris.items[i].string);
+ (int) the_hash_algo->hexsz,
+ packfile_uris.items[i].string);
strvec_push(&cmd.args, uri);
cmd.git_cmd = 1;
cmd.no_stdin = 1;
strvec_push(&gpg.args, fmt->program);
strvec_pushv(&gpg.args, fmt->verify_args);
strvec_pushl(&gpg.args,
- "--status-fd=1",
- "--verify", temp->filename.buf, "-",
- NULL);
+ "--status-fd=1",
+ "--verify", temp->filename.buf, "-",
+ NULL);
if (!gpg_status)
gpg_status = &buf;
struct strbuf gpg_status = STRBUF_INIT;
strvec_pushl(&gpg.args,
- use_format->program,
- "--status-fd=2",
- "-bsau", signing_key,
- NULL);
+ use_format->program,
+ "--status-fd=2",
+ "-bsau", signing_key,
+ NULL);
bottom = signature->len;
strvec_pushf(&cld.env_array, "GIT_COMMITTER_NAME=%s", user);
if (!getenv("GIT_COMMITTER_EMAIL"))
strvec_pushf(&cld.env_array,
- "GIT_COMMITTER_EMAIL=%s@http.%s", user, host);
+ "GIT_COMMITTER_EMAIL=%s@http.%s", user, host);
cld.argv = argv;
if (buffer_input || gzipped_request || req_len >= 0)
strvec_push(&commit_argv, oid_to_hex(&ref->new_oid));
if (!push_all && !is_null_oid(&ref->old_oid))
strvec_pushf(&commit_argv, "^%s",
- oid_to_hex(&ref->old_oid));
+ oid_to_hex(&ref->old_oid));
repo_init_revisions(the_repository, &revs, setup_git_directory());
setup_revisions(commit_argv.argc, commit_argv.argv, &revs, NULL);
revs.edge_hint = 0; /* just in case */
ip.in = tmpfile_fd;
if (preq->generate_keep) {
strvec_pushf(&ip.args, "--keep=git %"PRIuMAX,
- (uintmax_t)getpid());
+ (uintmax_t)getpid());
ip.out = 0;
} else {
ip.no_stdout = 1;
size_t size;
strvec_pushl(&cp.args, "log", "--no-color", "-p", "--no-merges",
- "--reverse", "--date-order", "--decorate=no",
- "--no-prefix",
- /*
- * Choose indicators that are not used anywhere
- * else in diffs, but still look reasonable
- * (e.g. will not be confusing when debugging)
- */
- "--output-indicator-new=>",
- "--output-indicator-old=<",
- "--output-indicator-context=#",
- "--no-abbrev-commit",
- "--pretty=medium",
- "--notes",
- NULL);
+ "--reverse", "--date-order", "--decorate=no",
+ "--no-prefix",
+ /*
+ * Choose indicators that are not used anywhere
+ * else in diffs, but still look reasonable
+ * (e.g. will not be confusing when debugging)
+ */
+ "--output-indicator-new=>",
+ "--output-indicator-old=<",
+ "--output-indicator-context=#",
+ "--no-abbrev-commit",
+ "--pretty=medium",
+ "--notes",
+ NULL);
if (other_arg)
strvec_pushv(&cp.args, other_arg->argv);
strvec_push(&cp.args, range);
if (item->pattern) {
const char *glob = strchr(prefix, '*');
strvec_pushf(ref_prefixes, "%.*s",
- (int)(glob - prefix),
- prefix);
+ (int)(glob - prefix),
+ prefix);
} else {
expand_ref_prefix(ref_prefixes, prefix);
}
struct strbuf rpc_result = STRBUF_INIT;
strvec_pushl(&args, "fetch-pack", "--stateless-rpc",
- "--stdin", "--lock-pack", NULL);
+ "--stdin", "--lock-pack", NULL);
if (options.followtags)
strvec_push(&args, "--include-tag");
if (options.thin)
strvec_pushf(&args, "--shallow-since=%s", options.deepen_since);
for (i = 0; i < options.deepen_not.nr; i++)
strvec_pushf(&args, "--shallow-exclude=%s",
- options.deepen_not.items[i].string);
+ options.deepen_not.items[i].string);
if (options.deepen_relative && options.depth)
strvec_push(&args, "--deepen-relative");
if (options.from_promisor)
strvec_init(&args);
strvec_pushl(&args, "send-pack", "--stateless-rpc", "--helper-status",
- NULL);
+ NULL);
if (options.thin)
strvec_push(&args, "--thin");
strvec_push(&args, "--verbose");
for (i = 0; i < options.push_options.nr; i++)
strvec_pushf(&args, "--push-option=%s",
- options.push_options.items[i].string);
+ options.push_options.items[i].string);
strvec_push(&args, options.progress ? "--progress" : "--no-progress");
for_each_string_list_item(cas_option, &cas_options)
strvec_push(&args, cas_option->string);
strvec_push(&argv, ""); /* ignored */
strvec_push(&argv, "--left-right");
strvec_pushf(&argv, "%s...%s",
- oid_to_hex(&ours->object.oid),
- oid_to_hex(&theirs->object.oid));
+ oid_to_hex(&ours->object.oid),
+ oid_to_hex(&theirs->object.oid));
strvec_push(&argv, "--");
repo_init_revisions(the_repository, &revs, NULL);
child_argv[0] = command_line;
strvec_pushf(&child_env, "GIT_DIR=%s", absolute_path(get_git_dir()));
strvec_pushf(&child_env, "GIT_WORK_TREE=%s",
- absolute_path(get_git_work_tree()));
+ absolute_path(get_git_work_tree()));
status = run_command_v_opt_cd_env(child_argv, RUN_USING_SHELL, NULL,
child_env.argv);
strvec_push(&cmd.args, strategy);
for (k = 0; k < opts->xopts_nr; k++)
strvec_pushf(&cmd.args,
- "-X%s", opts->xopts[k]);
+ "-X%s", opts->xopts[k]);
}
strvec_push(&cmd.args, "--no-edit");
strvec_push(&cmd.args, "--no-ff");
/* Add the tips to be merged */
for (j = to_merge; j; j = j->next)
strvec_push(&cmd.args,
- oid_to_hex(&j->item->object.oid));
+ oid_to_hex(&j->item->object.oid));
strbuf_release(&ref_name);
unlink(git_path_cherry_pick_head(r));
struct object_id oid;
strvec_pushl(&stash.args,
- "stash", "create", "autostash", NULL);
+ "stash", "create", "autostash", NULL);
stash.git_cmd = 1;
stash.no_stdin = 1;
strbuf_reset(&buf);
{
prepare_submodule_repo_env_no_git_dir(out);
strvec_pushf(out, "%s=%s", GIT_DIR_ENVIRONMENT,
- DEFAULT_GIT_DIR_ENVIRONMENT);
+ DEFAULT_GIT_DIR_ENVIRONMENT);
}
static void prepare_submodule_repo_env_in_gitdir(struct strvec *out)
if (o->flags.reverse_diff) {
strvec_pushf(&cp.args, "--src-prefix=%s%s/",
- o->b_prefix, path);
+ o->b_prefix, path);
strvec_pushf(&cp.args, "--dst-prefix=%s%s/",
- o->a_prefix, path);
+ o->a_prefix, path);
} else {
strvec_pushf(&cp.args, "--src-prefix=%s%s/",
- o->a_prefix, path);
+ o->a_prefix, path);
strvec_pushf(&cp.args, "--dst-prefix=%s%s/",
- o->b_prefix, path);
+ o->b_prefix, path);
}
strvec_push(&cp.args, oid_to_hex(old_oid));
/*
const struct string_list_item *item;
for_each_string_list_item(item, push_options)
strvec_pushf(&cp.args, "--push-option=%s",
- item->string);
+ item->string);
}
if (remote->origin != REMOTE_UNCONFIGURED) {
return 1;
strvec_pushl(&cp.args, "status", "--porcelain",
- "--ignore-submodules=none", NULL);
+ "--ignore-submodules=none", NULL);
if (flags & SUBMODULE_REMOVAL_IGNORE_UNTRACKED)
strvec_push(&cp.args, "-uno");
cp.git_cmd = 1;
strvec_pushl(&cp.args, "diff-index", "--quiet",
- "--cached", "HEAD", NULL);
+ "--cached", "HEAD", NULL);
cp.no_stdin = 1;
cp.no_stdout = 1;
cp.dir = sub->path;
cp.dir = path;
strvec_pushf(&cp.args, "--super-prefix=%s%s/",
- get_super_prefix_or_empty(), path);
+ get_super_prefix_or_empty(), path);
strvec_pushl(&cp.args, "read-tree", "-u", "--reset", NULL);
strvec_push(&cp.args, empty_tree_oid_hex());
cp.dir = path;
strvec_pushf(&cp.args, "--super-prefix=%s%s/",
- get_super_prefix_or_empty(), path);
+ get_super_prefix_or_empty(), path);
strvec_pushl(&cp.args, "read-tree", "--recurse-submodules", NULL);
if (flags & SUBMODULE_MOVE_HEAD_DRY_RUN)
prepare_submodule_repo_env(&cp.env_array);
strvec_pushl(&cp.args, "update-ref", "HEAD",
- "--no-deref", new_head, NULL);
+ "--no-deref", new_head, NULL);
if (run_command(&cp)) {
ret = -1;
cp.git_cmd = 1;
cp.no_stdin = 1;
strvec_pushl(&cp.args, "--super-prefix", sb.buf,
- "submodule--helper",
- "absorb-git-dirs", NULL);
+ "submodule--helper",
+ "absorb-git-dirs", NULL);
prepare_submodule_repo_env(&cp.env_array);
if (run_command(&cp))
die(_("could not recurse into submodule '%s'"), path);
strvec_pop(&cp.env_array);
strvec_pushl(&cp.args, "--literal-pathspecs", "-C", "..",
- "ls-files", "-z", "--stage", "--full-name", "--",
- subpath, NULL);
+ "ls-files", "-z", "--stage", "--full-name", "--",
+ subpath, NULL);
strbuf_reset(&sb);
cp.no_stdin = 1;
strvec_clear(&args);
if (msys2)
strvec_pushl(&args, "sh", "-c",
- "printf %s\\\\0 \"$@\"", "skip", NULL);
+ "printf %s\\\\0 \"$@\"", "skip", NULL);
else
strvec_pushl(&args, "test-tool", "run-command",
- "quote-echo", NULL);
+ "quote-echo", NULL);
arg_offset = args.argc;
if (argc > 0) {
tmp = xmkstemp(path);
strvec_pushl(&cp.args,
- "test-tool", argv0, "inherited-handle-child", NULL);
+ "test-tool", argv0, "inherited-handle-child", NULL);
cp.in = -1;
cp.no_stdout = cp.no_stderr = 1;
if (start_command(&cp) < 0)
if (have_git_dir())
strvec_pushf(&helper->env_array, "%s=%s",
- GIT_DIR_ENVIRONMENT, get_git_dir());
+ GIT_DIR_ENVIRONMENT, get_git_dir());
helper->trace2_child_class = helper->args.argv[0]; /* "remote-<name>" */
strvec_pushf(&pack_objects.args, "--filter=%s", buf.buf);
strbuf_release(&buf);
} else {
- strvec_pushf(&pack_objects.args, "--filter=%s",
- spec);
+ strvec_pushf(&pack_objects.args, "--filter=%s", spec);
}
}
if (uri_protocols) {
struct strbuf summary = STRBUF_INIT;
char *summary_content;
- strvec_pushf(&sm_summary.env_array, "GIT_INDEX_FILE=%s",
- s->index_file);
+ strvec_pushf(&sm_summary.env_array, "GIT_INDEX_FILE=%s", s->index_file);
strvec_push(&sm_summary.args, "submodule");
strvec_push(&sm_summary.args, "summary");