merge-recursive: fix numerous argument alignment issues
Various refactorings throughout the code have left lots of alignment issues that were driving me crazy; fix them. Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elijah Newren committed
Jun 9, 2018 at 21:16 UTC
d90e759fd5d8c30ab37ecccbaa3a00c85682eaf9
1 file changed
+38
-37
merge-recursive.c
+38
-37
@@ -309,8 +309,8 @@ static void output_commit_title(struct merge_options *o, struct commit *commit)
309
}
310
311
static int add_cacheinfo(struct merge_options *o,
312
- unsigned int mode, const struct object_id *oid,
313
- const char *path, int stage, int refresh, int options)
312
+ unsigned int mode, const struct object_id *oid,
313
+ const char *path, int stage, int refresh, int options)
314
{
315
struct cache_entry *ce;
316
int ret;
@@ -417,8 +417,8 @@ struct tree *write_tree_from_memory(struct merge_options *o)
417
}
418
419
static int save_files_dirs(const struct object_id *oid,
420
- struct strbuf *base, const char *path,
421
- unsigned int mode, int stage, void *context)
420
+ struct strbuf *base, const char *path,
421
+ unsigned int mode, int stage, void *context)
422
{
423
struct path_hashmap_entry *entry;
424
int baselen = base->len;
@@ -913,7 +913,7 @@ static int make_room_for_path(struct merge_options *o, const char *path)
913
*/
914
if (would_lose_untracked(path))
915
return err(o, _("refusing to lose untracked file at '%s'"),
916
- path);
916
+ path);
917
918
/* Successful unlink is good.. */
919
if (!unlink(path))
@@ -992,7 +992,7 @@ static int update_file_flags(struct merge_options *o,
992
unlink(path);
993
if (symlink(lnk, path))
994
ret = err(o, _("failed to symlink '%s': %s"),
995
- path, strerror(errno));
995
+ path, strerror(errno));
996
free(lnk);
997
} else
998
ret = err(o,
@@ -1090,7 +1090,7 @@ static int merge_3way(struct merge_options *o,
1090
}
1091
1092
static int find_first_merges(struct object_array *result, const char *path,
1093
- struct commit *a, struct commit *b)
1093
+ struct commit *a, struct commit *b)
1094
{
1095
int i, j;
1096
struct object_array merges = OBJECT_ARRAY_INIT;
@@ -1108,7 +1108,7 @@ static int find_first_merges(struct object_array *result, const char *path,
1108
1109
/* get all revisions that merge commit a */
1110
xsnprintf(merged_revision, sizeof(merged_revision), "^%s",
1111
- oid_to_hex(&a->object.oid));
1111
+ oid_to_hex(&a->object.oid));
1112
init_revisions(&revs, NULL);
1113
rev_opts.submodule = path;
1114
/* FIXME: can't handle linked worktrees in submodules yet */
@@ -1250,12 +1250,12 @@ static int merge_submodule(struct merge_options *o,
1250
output(o, 2, _("Found a possible merge resolution for the submodule:\n"));
1251
print_commit((struct commit *) merges.objects[0].item);
1252
output(o, 2, _(
1253
- "If this is correct simply add it to the index "
1254
- "for example\n"
1255
- "by using:\n\n"
1256
- " git update-index --cacheinfo 160000 %s \"%s\"\n\n"
1257
- "which will accept this suggestion.\n"),
1258
- oid_to_hex(&merges.objects[0].item->oid), path);
1253
+ "If this is correct simply add it to the index "
1254
+ "for example\n"
1255
+ "by using:\n\n"
1256
+ " git update-index --cacheinfo 160000 %s \"%s\"\n\n"
1257
+ "which will accept this suggestion.\n"),
1258
+ oid_to_hex(&merges.objects[0].item->oid), path);
1259
break;
1260
1261
default:
@@ -1332,10 +1332,10 @@ static int merge_file_1(struct merge_options *o,
1332
result->clean = (merge_status == 0);
1333
} else if (S_ISGITLINK(a->mode)) {
1334
result->clean = merge_submodule(o, &result->oid,
1335
- one->path,
1336
- &one->oid,
1337
- &a->oid,
1338
- &b->oid);
1335
+ one->path,
1336
+ &one->oid,
1337
+ &a->oid,
1338
+ &b->oid);
1339
} else if (S_ISLNK(a->mode)) {
1340
switch (o->recursive_variant) {
1341
case MERGE_RECURSIVE_NORMAL:
@@ -1443,13 +1443,13 @@ static int conflict_rename_dir(struct merge_options *o,
1443
}
1444
1445
static int handle_change_delete(struct merge_options *o,
1446
- const char *path, const char *old_path,
1447
- const struct object_id *o_oid, int o_mode,
1448
- const struct object_id *changed_oid,
1449
- int changed_mode,
1450
- const char *change_branch,
1451
- const char *delete_branch,
1452
- const char *change, const char *change_past)
1446
+ const char *path, const char *old_path,
1447
+ const struct object_id *o_oid, int o_mode,
1448
+ const struct object_id *changed_oid,
1449
+ int changed_mode,
1450
+ const char *change_branch,
1451
+ const char *delete_branch,
1452
+ const char *change, const char *change_past)
1453
{
1454
char *alt_path = NULL;
1455
const char *update_path = path;
@@ -1510,9 +1510,9 @@ static int handle_change_delete(struct merge_options *o,
1510
}
1511
1512
static int conflict_rename_delete(struct merge_options *o,
1513
- struct diff_filepair *pair,
1514
- const char *rename_branch,
1515
- const char *delete_branch)
1513
+ struct diff_filepair *pair,
1514
+ const char *rename_branch,
1515
+ const char *delete_branch)
1516
{
1517
const struct diff_filespec *orig = pair->one;
1518
const struct diff_filespec *dest = pair->two;
@@ -1615,7 +1615,7 @@ static int handle_file(struct merge_options *o,
1615
}
1616
1617
static int conflict_rename_rename_1to2(struct merge_options *o,
1618
- struct rename_conflict_info *ci)
1618
+ struct rename_conflict_info *ci)
1619
{
1620
/* One file was renamed in both branches, but to different names. */
1621
struct diff_filespec *one = ci->pair1->one;
@@ -1677,7 +1677,7 @@ static int conflict_rename_rename_1to2(struct merge_options *o,
1677
}
1678
1679
static int conflict_rename_rename_2to1(struct merge_options *o,
1680
- struct rename_conflict_info *ci)
1680
+ struct rename_conflict_info *ci)
1681
{
1682
/* Two files, a & b, were renamed to the same thing, c. */
1683
struct diff_filespec *a = ci->pair1->one;
@@ -2904,7 +2904,8 @@ static struct object_id *stage_oid(const struct object_id *oid, unsigned mode)
2904
}
2905
2906
static int read_oid_strbuf(struct merge_options *o,
2907
- const struct object_id *oid, struct strbuf *dst)
2907
+ const struct object_id *oid,
2908
+ struct strbuf *dst)
2909
{
2910
void *buf;
2911
enum object_type type;
@@ -2957,10 +2958,10 @@ error_return:
2958
}
2959
2960
static int handle_modify_delete(struct merge_options *o,
2960
- const char *path,
2961
- struct object_id *o_oid, int o_mode,
2962
- struct object_id *a_oid, int a_mode,
2963
- struct object_id *b_oid, int b_mode)
2961
+ const char *path,
2962
+ struct object_id *o_oid, int o_mode,
2963
+ struct object_id *a_oid, int a_mode,
2964
+ struct object_id *b_oid, int b_mode)
2965
{
2966
const char *modify_branch, *delete_branch;
2967
struct object_id *changed_oid;
@@ -3493,14 +3494,14 @@ int merge_recursive_generic(struct merge_options *o,
3494
struct commit *base;
3495
if (!(base = get_ref(base_list[i], oid_to_hex(base_list[i]))))
3496
return err(o, _("Could not parse object '%s'"),
3496
- oid_to_hex(base_list[i]));
3497
+ oid_to_hex(base_list[i]));
3498
commit_list_insert(base, &ca);
3499
}
3500
}
3501
3502
hold_locked_index(&lock, LOCK_DIE_ON_ERROR);
3503
clean = merge_recursive(o, head_commit, next_commit, ca,
3503
- result);
3504
+ result);
3505
if (clean < 0) {
3506
rollback_lock_file(&lock);
3507
return clean;