Skip to content

Commit 0282f67

Browse files
peffgitster
authored andcommitted
fsck_tree(): wrap some long lines
Many calls to report() in fsck_tree() are kept on a single line and are quite long. Most were pretty big to begin with, but have gotten even longer over the years as we've added more parameters. Let's accept the churn of wrapping them in order to conform to our usual line limits. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9e1947c commit 0282f67

File tree

1 file changed

+36
-12
lines changed

1 file changed

+36
-12
lines changed

fsck.c

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,9 @@ static int fsck_tree(const struct object_id *tree_oid,
579579
struct name_stack df_dup_candidates = { NULL };
580580

581581
if (init_tree_desc_gently(&desc, buffer, size)) {
582-
retval += report(options, tree_oid, OBJ_TREE, FSCK_MSG_BAD_TREE, "cannot be parsed as a tree");
582+
retval += report(options, tree_oid, OBJ_TREE,
583+
FSCK_MSG_BAD_TREE,
584+
"cannot be parsed as a tree");
583585
return retval;
584586
}
585587

@@ -630,7 +632,9 @@ static int fsck_tree(const struct object_id *tree_oid,
630632
}
631633

632634
if (update_tree_entry_gently(&desc)) {
633-
retval += report(options, tree_oid, OBJ_TREE, FSCK_MSG_BAD_TREE, "cannot be parsed as a tree");
635+
retval += report(options, tree_oid, OBJ_TREE,
636+
FSCK_MSG_BAD_TREE,
637+
"cannot be parsed as a tree");
634638
break;
635639
}
636640

@@ -678,25 +682,45 @@ static int fsck_tree(const struct object_id *tree_oid,
678682
name_stack_clear(&df_dup_candidates);
679683

680684
if (has_null_sha1)
681-
retval += report(options, tree_oid, OBJ_TREE, FSCK_MSG_NULL_SHA1, "contains entries pointing to null sha1");
685+
retval += report(options, tree_oid, OBJ_TREE,
686+
FSCK_MSG_NULL_SHA1,
687+
"contains entries pointing to null sha1");
682688
if (has_full_path)
683-
retval += report(options, tree_oid, OBJ_TREE, FSCK_MSG_FULL_PATHNAME, "contains full pathnames");
689+
retval += report(options, tree_oid, OBJ_TREE,
690+
FSCK_MSG_FULL_PATHNAME,
691+
"contains full pathnames");
684692
if (has_empty_name)
685-
retval += report(options, tree_oid, OBJ_TREE, FSCK_MSG_EMPTY_NAME, "contains empty pathname");
693+
retval += report(options, tree_oid, OBJ_TREE,
694+
FSCK_MSG_EMPTY_NAME,
695+
"contains empty pathname");
686696
if (has_dot)
687-
retval += report(options, tree_oid, OBJ_TREE, FSCK_MSG_HAS_DOT, "contains '.'");
697+
retval += report(options, tree_oid, OBJ_TREE,
698+
FSCK_MSG_HAS_DOT,
699+
"contains '.'");
688700
if (has_dotdot)
689-
retval += report(options, tree_oid, OBJ_TREE, FSCK_MSG_HAS_DOTDOT, "contains '..'");
701+
retval += report(options, tree_oid, OBJ_TREE,
702+
FSCK_MSG_HAS_DOTDOT,
703+
"contains '..'");
690704
if (has_dotgit)
691-
retval += report(options, tree_oid, OBJ_TREE, FSCK_MSG_HAS_DOTGIT, "contains '.git'");
705+
retval += report(options, tree_oid, OBJ_TREE,
706+
FSCK_MSG_HAS_DOTGIT,
707+
"contains '.git'");
692708
if (has_zero_pad)
693-
retval += report(options, tree_oid, OBJ_TREE, FSCK_MSG_ZERO_PADDED_FILEMODE, "contains zero-padded file modes");
709+
retval += report(options, tree_oid, OBJ_TREE,
710+
FSCK_MSG_ZERO_PADDED_FILEMODE,
711+
"contains zero-padded file modes");
694712
if (has_bad_modes)
695-
retval += report(options, tree_oid, OBJ_TREE, FSCK_MSG_BAD_FILEMODE, "contains bad file modes");
713+
retval += report(options, tree_oid, OBJ_TREE,
714+
FSCK_MSG_BAD_FILEMODE,
715+
"contains bad file modes");
696716
if (has_dup_entries)
697-
retval += report(options, tree_oid, OBJ_TREE, FSCK_MSG_DUPLICATE_ENTRIES, "contains duplicate file entries");
717+
retval += report(options, tree_oid, OBJ_TREE,
718+
FSCK_MSG_DUPLICATE_ENTRIES,
719+
"contains duplicate file entries");
698720
if (not_properly_sorted)
699-
retval += report(options, tree_oid, OBJ_TREE, FSCK_MSG_TREE_NOT_SORTED, "not properly sorted");
721+
retval += report(options, tree_oid, OBJ_TREE,
722+
FSCK_MSG_TREE_NOT_SORTED,
723+
"not properly sorted");
700724
return retval;
701725
}
702726

0 commit comments

Comments
 (0)