blame: create scoreboard init function

Create function that initializes blame_scoreboard to default values. Signed-off-by: Jeff Smith <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff Smith committed May 24, 2017 at 00:15 UTC 6e4c9b5bcf2c4c9e29513949ad8b465d7afe88f1
1 file changed +8 -3
builtin/blame.c
+8 -3
@@ -2537,6 +2537,13 @@ static int blame_move_callback(const struct option *option, const char *arg, int
2537 return 0;
2538 }
2539
2540 +void init_scoreboard(struct blame_scoreboard *sb)
2541 +{
2542 + memset(sb, 0, sizeof(struct blame_scoreboard));
2543 + sb->move_score = BLAME_DEFAULT_MOVE_SCORE;
2544 + sb->copy_score = BLAME_DEFAULT_COPY_SCORE;
2545 +}
2546 +
2547 int cmd_blame(int argc, const char **argv, const char *prefix)
2548 {
2549 struct rev_info revs;
@@ -2747,10 +2754,8 @@ parse_done:
2754
2755 revs.disable_stdin = 1;
2756 setup_revisions(argc, argv, &revs, NULL);
2750 - memset(&sb, 0, sizeof(sb));
2751 - sb.move_score = BLAME_DEFAULT_MOVE_SCORE;
2752 - sb.copy_score = BLAME_DEFAULT_COPY_SCORE;
2757
2758 + init_scoreboard(&sb);
2759 sb.revs = &revs;
2760 sb.contents_from = contents_from;
2761 sb.reverse = reverse;