Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions packages/core/src/countBallotsFromGit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,23 @@ export default async function countFromGit({
} finally {
await fd.close();
}
await runChildProcessAsync(GIT_BIN, ["add", filepath], { spawnArgs });

// Remove all vote related files.
await runChildProcessAsync(GIT_BIN, ["rm", "-rf", subPath], { spawnArgs });
await runChildProcessAsync(
GIT_BIN,
[
"restore",
"--source",
`${firstCommitRef}^`,
"--staged",
"--worktree",
"--",
".",
],
{ spawnArgs }
);

await runChildProcessAsync(GIT_BIN, ["add", filepath], { spawnArgs });

await runChildProcessAsync(
GIT_BIN,
Expand Down