1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-25 11:16:10 +02:00

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>
This commit is contained in:
Jeff Smith 2017-05-24 00:15:29 -05:00 committed by Junio C Hamano
parent 835c49f7d1
commit 6e4c9b5bcf

View File

@ -2537,6 +2537,13 @@ static int blame_move_callback(const struct option *option, const char *arg, int
return 0;
}
void init_scoreboard(struct blame_scoreboard *sb)
{
memset(sb, 0, sizeof(struct blame_scoreboard));
sb->move_score = BLAME_DEFAULT_MOVE_SCORE;
sb->copy_score = BLAME_DEFAULT_COPY_SCORE;
}
int cmd_blame(int argc, const char **argv, const char *prefix)
{
struct rev_info revs;
@ -2747,10 +2754,8 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
revs.disable_stdin = 1;
setup_revisions(argc, argv, &revs, NULL);
memset(&sb, 0, sizeof(sb));
sb.move_score = BLAME_DEFAULT_MOVE_SCORE;
sb.copy_score = BLAME_DEFAULT_COPY_SCORE;
init_scoreboard(&sb);
sb.revs = &revs;
sb.contents_from = contents_from;
sb.reverse = reverse;