From c215f6c21807cc54018e1acd2d4f7e31bb85f0c4 Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Thu, 28 Apr 2016 19:47:54 -0700 Subject: [PATCH] Loop to fill files. --- extract-code-added-in-commits.plx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/extract-code-added-in-commits.plx b/extract-code-added-in-commits.plx index bffb909..66139b6 100755 --- a/extract-code-added-in-commits.plx +++ b/extract-code-added-in-commits.plx @@ -150,11 +150,15 @@ sub ProcessCommit($$;$) { sub RunCentralCommitMode($) { my($centralCommitId) = @_; + print "Creating Repository object with args $GIT_REPOSITORY_PATH\n" if ($VERBOSE >= 6); my $gitRepository = Git::Repository->new(git_dir => $GIT_REPOSITORY_PATH); + my %files; foreach my $commitId (keys %WHITELIST_COMMIT_IDS) { - my(@commitFiles) = $gitRepository->run('show', '--pretty="format:"', '--name-only'); - print join("\n", @commitFiles); + my(@commitFiles) = $gitRepository->run('show', '--pretty=format:', '--name-only', $commitId); + foreach my $file (@commitFiles) { + $files{$file} = $commitId if not defined $files{$file}; + } } }