336
*/
337
cp.git_cmd = 1;
338
strvec_pushl(&cp.args, "diff-index", "--cached", "--name-only",
339
- "--diff-filter=A", NULL);
339
+ "--diff-filter=A", NULL);
340
strvec_push(&cp.args, c_tree_hex);
341
return pipe_command(&cp, NULL, 0, out, 0, NULL, 0);
342
}
368
strvec_push(&cp.args, "read-tree");
369
strvec_push(&cp.args, oid_to_hex(u_tree));
370
strvec_pushf(&cp.env_array, "GIT_INDEX_FILE=%s",
371
- stash_index_path.buf);
371
+ stash_index_path.buf);
372
if (run_command(&cp)) {
373
remove_path(stash_index_path.buf);
374
return -1;
378
cp.git_cmd = 1;
379
strvec_pushl(&cp.args, "checkout-index", "--all", NULL);
380
strvec_pushf(&cp.env_array, "GIT_INDEX_FILE=%s",
381
- stash_index_path.buf);
381
+ stash_index_path.buf);
382
383
res = run_command(&cp);
384
remove_path(stash_index_path.buf);
500
cp.git_cmd = 1;
501
cp.dir = prefix;
502
strvec_pushf(&cp.env_array, GIT_WORK_TREE_ENVIRONMENT"=%s",
503
- absolute_path(get_git_work_tree()));
503
+ absolute_path(get_git_work_tree()));
504
strvec_pushf(&cp.env_array, GIT_DIR_ENVIRONMENT"=%s",
505
- absolute_path(get_git_dir()));
505
+ absolute_path(get_git_dir()));
506
strvec_push(&cp.args, "status");
507
run_command(&cp);
508
}
547
548
cp_reflog.git_cmd = 1;
549
strvec_pushl(&cp_reflog.args, "reflog", "delete", "--updateref",
550
- "--rewrite", NULL);
550
+ "--rewrite", NULL);
551
strvec_push(&cp_reflog.args, info->revision.buf);
552
ret = run_command(&cp_reflog);
553
if (!ret) {
693
694
cp.git_cmd = 1;
695
strvec_pushl(&cp.args, "log", "--format=%gd: %gs", "-g",
696
- "--first-parent", "-m", NULL);
696
+ "--first-parent", "-m", NULL);
697
strvec_pushv(&cp.args, argv);
698
strvec_push(&cp.args, ref_stash);
699
strvec_push(&cp.args, "--");
961
962
cp_upd_index.git_cmd = 1;
963
strvec_pushl(&cp_upd_index.args, "update-index", "-z", "--add",
964
- "--remove", "--stdin", NULL);
964
+ "--remove", "--stdin", NULL);
965
strvec_pushf(&cp_upd_index.env_array, "GIT_INDEX_FILE=%s",
966
stash_index_path.buf);
967
1005
cp_read_tree.git_cmd = 1;
1006
strvec_pushl(&cp_read_tree.args, "read-tree", "HEAD", NULL);
1007
strvec_pushf(&cp_read_tree.env_array, "GIT_INDEX_FILE=%s",
1008
- stash_index_path.buf);
1008
+ stash_index_path.buf);
1009
if (run_command(&cp_read_tree)) {
1010
ret = -1;
1011
goto done;
1035
1036
cp_diff_tree.git_cmd = 1;
1037
strvec_pushl(&cp_diff_tree.args, "diff-tree", "-p", "-U1", "HEAD",
1038
- oid_to_hex(&info->w_tree), "--", NULL);
1038
+ oid_to_hex(&info->w_tree), "--", NULL);
1039
if (pipe_command(&cp_diff_tree, NULL, 0, out_patch, 0, NULL, 0)) {
1040
ret = -1;
1041
goto done;
1089
1090
cp_upd_index.git_cmd = 1;
1091
strvec_pushl(&cp_upd_index.args, "update-index",
1092
- "--ignore-skip-worktree-entries",
1093
- "-z", "--add", "--remove", "--stdin", NULL);
1092
+ "--ignore-skip-worktree-entries",
1093
+ "-z", "--add", "--remove", "--stdin", NULL);
1094
strvec_pushf(&cp_upd_index.env_array, "GIT_INDEX_FILE=%s",
1095
- stash_index_path.buf);
1095
+ stash_index_path.buf);
1096
1097
if (pipe_command(&cp_upd_index, diff_output.buf, diff_output.len,
1098
NULL, 0, NULL, 0)) {
1343
1344
cp.git_cmd = 1;
1345
strvec_pushl(&cp.args, "clean", "--force",
1346
- "--quiet", "-d", NULL);
1346
+ "--quiet", "-d", NULL);
1347
if (include_untracked == INCLUDE_ALL_FILES)
1348
strvec_push(&cp.args, "-x");
1349
if (run_command(&cp)) {
1373
1374
cp_diff.git_cmd = 1;
1375
strvec_pushl(&cp_diff.args, "diff-index", "-p",
1376
- "--cached", "--binary", "HEAD", "--",
1377
- NULL);
1376
+ "--cached", "--binary", "HEAD", "--",
1377
+ NULL);
1378
add_pathspecs(&cp_diff.args, ps);
1379
if (pipe_command(&cp_diff, NULL, 0, &out, 0, NULL, 0)) {
1380
ret = -1;
1383
1384
cp_apply.git_cmd = 1;
1385
strvec_pushl(&cp_apply.args, "apply", "--index",
1386
- "-R", NULL);
1386
+ "-R", NULL);
1387
if (pipe_command(&cp_apply, out.buf, out.len, NULL, 0,
1388
NULL, 0)) {
1389
ret = -1;
1393
struct child_process cp = CHILD_PROCESS_INIT;
1394
cp.git_cmd = 1;
1395
strvec_pushl(&cp.args, "reset", "--hard", "-q",
1396
- "--no-recurse-submodules", NULL);
1396
+ "--no-recurse-submodules", NULL);
1397
if (run_command(&cp)) {
1398
ret = -1;
1399
goto done;
1405
1406
cp.git_cmd = 1;
1407
strvec_pushl(&cp.args, "checkout", "--no-overlay",
1408
- oid_to_hex(&info.i_tree), "--", NULL);
1408
+ oid_to_hex(&info.i_tree), "--", NULL);
1409
if (!ps->nr)
1410
strvec_push(&cp.args, ":/");
1411
else