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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed May 1, 2021 at 11:41 UTC 0282f6799f2ca9c2d3f000976856282b7c69d238
1 file changed +36 -12
fsck.c
+36 -12
@@ -579,7 +579,9 @@ static int fsck_tree(const struct object_id *tree_oid,
579 struct name_stack df_dup_candidates = { NULL };
580
581 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");
585 return retval;
586 }
587
@@ -630,7 +632,9 @@ static int fsck_tree(const struct object_id *tree_oid,
632 }
633
634 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");
638 break;
639 }
640
@@ -678,25 +682,45 @@ static int fsck_tree(const struct object_id *tree_oid,
682 name_stack_clear(&df_dup_candidates);
683
684 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");
688 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");
692 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");
696 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 '.'");
700 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 '..'");
704 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'");
708 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");
712 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");
716 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");
720 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");
724 return retval;
725 }
726