summaryrefslogtreecommitdiff
path: root/add-patch.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2020-07-28 20:26:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-07-28 22:02:18 (GMT)
commitf6d8942b1fc6c968980c8ae03054d7b2114b4415 (patch)
treeded3f10f7d390a4dba264c70197b00bc327fae40 /add-patch.c
parentc972bf4cf546a56fe1c54ddde1d33ebb9f454a0f (diff)
downloadgit-f6d8942b1fc6c968980c8ae03054d7b2114b4415.zip
git-f6d8942b1fc6c968980c8ae03054d7b2114b4415.tar.gz
git-f6d8942b1fc6c968980c8ae03054d7b2114b4415.tar.bz2
strvec: fix indentation in renamed calls
Code which split an argv_array call across multiple lines, like: argv_array_pushl(&args, "one argument", "another argument", "and more", NULL); was recently mechanically renamed to use strvec, which results in mis-matched indentation like: strvec_pushl(&args, "one argument", "another argument", "and more", NULL); Let's fix these up to align the arguments with the opening paren. I did this manually by sifting through the results of: git jump grep 'strvec_.*,$' and liberally applying my editor's auto-format. Most of the changes are of the form shown above, though I also normalized a few that had originally used a single-tab indentation (rather than our usual style of aligning with the open paren). I also rewrapped a couple of obvious cases (e.g., where previously too-long lines became short enough to fit on one), but I wasn't aggressive about it. In cases broken to three or more lines, the grouping of arguments is sometimes meaningful, and it wasn't worth my time or reviewer time to ponder each case individually. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'add-patch.c')
-rw-r--r--add-patch.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/add-patch.c b/add-patch.c
index 3c91ae5..8c07728 100644
--- a/add-patch.c
+++ b/add-patch.c
@@ -291,7 +291,7 @@ static void setup_child_process(struct add_p_state *s,
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,
@@ -386,10 +386,10 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)
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`. */