summaryrefslogtreecommitdiff
path: root/builtin/blame.c
diff options
context:
space:
mode:
authorJeff Smith <whydoubt@gmail.com>2017-05-24 05:15:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-25 04:08:22 (GMT)
commit6e4c9b5bcf2c4c9e29513949ad8b465d7afe88f1 (patch)
treed63f697173e94ae2e66e14a0a503f6b8c7475629 /builtin/blame.c
parent835c49f7d16c5f0307e71da19618fcfe500c2430 (diff)
downloadgit-6e4c9b5bcf2c4c9e29513949ad8b465d7afe88f1.zip
git-6e4c9b5bcf2c4c9e29513949ad8b465d7afe88f1.tar.gz
git-6e4c9b5bcf2c4c9e29513949ad8b465d7afe88f1.tar.bz2
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>
Diffstat (limited to 'builtin/blame.c')
-rw-r--r--builtin/blame.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/builtin/blame.c b/builtin/blame.c
index e343520..f839571 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -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 @@ parse_done:
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;