Skip to content

Commit 6e4c9b5

Browse files
whydoubtgitster
authored andcommitted
blame: create scoreboard init function
Create function that initializes blame_scoreboard to default values. Signed-off-by: Jeff Smith <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 835c49f commit 6e4c9b5

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

builtin/blame.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2537,6 +2537,13 @@ static int blame_move_callback(const struct option *option, const char *arg, int
25372537
return 0;
25382538
}
25392539

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+
25402547
int cmd_blame(int argc, const char **argv, const char *prefix)
25412548
{
25422549
struct rev_info revs;
@@ -2747,10 +2754,8 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
27472754

27482755
revs.disable_stdin = 1;
27492756
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;
27532757

2758+
init_scoreboard(&sb);
27542759
sb.revs = &revs;
27552760
sb.contents_from = contents_from;
27562761
sb.reverse = reverse;

0 commit comments

Comments
 (0)