From f165c689c3e4e4b42ef74aee8885753ecfe0628f Mon Sep 17 00:00:00 2001 From: 19mdavenport Date: Sat, 22 Jun 2024 22:36:41 +0000 Subject: [PATCH] fix test merge error --- .../java/edu/byu/cs/autograder/git/GitHelperUtils.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/java/edu/byu/cs/autograder/git/GitHelperUtils.java b/src/test/java/edu/byu/cs/autograder/git/GitHelperUtils.java index 00dd9b350..e96e9d3f1 100644 --- a/src/test/java/edu/byu/cs/autograder/git/GitHelperUtils.java +++ b/src/test/java/edu/byu/cs/autograder/git/GitHelperUtils.java @@ -185,7 +185,7 @@ void makeCommit(RepoContext repoContext, String content, Instant commitTimestamp GitEvaluator evaluateRepo() { - return evaluateRepo(gradingContext, null); + return evaluateRepo(gradingContext, GitHelper.MIN_COMMIT_THRESHOLD); } GitEvaluator evaluateRepo(@Nullable CommitThreshold minThreshold) { return evaluateRepo(gradingContext, minThreshold); @@ -194,11 +194,11 @@ GitEvaluator evaluateRepo(GradingContext gradingContex return evaluateRepo(new GitHelper(gradingContext), minThreshold); } GitEvaluator evaluateRepo(GitHelper gitHelper, @Nullable CommitThreshold minThreshold) { - var effectiveMinThreshold = minThreshold != null ? minThreshold : GitHelper.MIN_COMMIT_THRESHOLD; return git -> { - String phase0HeadHash = GitHelper.getHeadHash(git); - CommitThreshold maxThreshold = new CommitThreshold(Instant.now(), phase0HeadHash); - return gitHelper.verifyRegularCommits(git, effectiveMinThreshold, maxThreshold); + String currentHeadHash = GitHelper.getHeadHash(git); + var maxTimeThreshold = Instant.now().plusSeconds(gradingContext.verificationConfig().forgivenessMinutesHead() * 60L); + CommitThreshold maxThreshold = new CommitThreshold(maxTimeThreshold, currentHeadHash); + return gitHelper.verifyRegularCommits(git, minThreshold, maxThreshold); }; }