Skip to content

Commit

Permalink
fix: increase window for finding recent commits to a week instead of …
Browse files Browse the repository at this point in the history
…a day (#2342)
  • Loading branch information
MaxKless authored Dec 5, 2024
1 parent 8d01db3 commit c0b5d60
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ function getRecentlyCommittedGitBranches(
): { name: string; time: string }[] {
try {
const localUserEmail = execSync('git config user.email').toString().trim();
const oneHourAgo = new Date(Date.now() - 60 * 60 * 24 * 1000).toISOString();
const oneWeekAgo = new Date(
Date.now() - 60 * 60 * 24 * 7 * 1000
).toISOString();

const res = execSync(
'git for-each-ref --count=10 --sort=-committerdate refs/heads/ --format="%(refname) - %(committerdate:iso-strict) - %(authoremail)"',
Expand All @@ -108,7 +110,7 @@ function getRecentlyCommittedGitBranches(
};
})
.filter((item) => {
return item.email.includes(localUserEmail) && item.time >= oneHourAgo;
return item.email.includes(localUserEmail) && item.time >= oneWeekAgo;
});

return branches;
Expand Down

0 comments on commit c0b5d60

Please sign in to comment.