Skip to content

Commit

Permalink
1-commit variant without committedByDiflow works
Browse files Browse the repository at this point in the history
  • Loading branch information
SPRINX0\prochazka committed Feb 19, 2025
1 parent 747c747 commit e57e097
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ class CommitProcessor {
await runGitCommand(this.processor.repoPaths[repoid], `push`);
if (repoid !== 'config') {
const hash = await getLastCommitHash(this.processor.repoPaths[repoid]);
this.state![repoid][this.branchProcessor.branch].committedByDiflow.push(hash);
this.state![repoid][this.branchProcessor.branch].lastProcessed = hash;
// this.state![repoid][this.branchProcessor.branch].committedByDiflow.push(hash);
}
console.log('Commiting changes for repo:', repoid, 'DONE.');
}
Expand Down
22 changes: 11 additions & 11 deletions src/testrepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,17 @@ export async function afterDiflow() {
}

export async function checkStateInConfig() {
// const stateContent = await fs.readFile(path.join(getTestRepoPath('config'), 'state.json'), 'utf8');
// const state = JSON.parse(stateContent) as State;
// const baseHash = await getHeadCommitInRepo(getTestRepoPath('base'));
// const diffHash = await getHeadCommitInRepo(getTestRepoPath('diff'));
// const mergedHash = await getHeadCommitInRepo(getTestRepoPath('merged'));
const stateContent = await fs.readFile(path.join(getTestRepoPath('config'), 'state.json'), 'utf8');
const state = JSON.parse(stateContent) as State;
const baseHash = await getHeadCommitInRepo(getTestRepoPath('base'));
const diffHash = await getHeadCommitInRepo(getTestRepoPath('diff'));
const mergedHash = await getHeadCommitInRepo(getTestRepoPath('merged'));

// expect(state['base']['master'].lastProcessed).toBe(baseHash);
// expect(state['diff']['master'].lastProcessed).toBe(diffHash);
// expect(state['merged']['master'].lastProcessed).toBe(mergedHash);
expect(state['base']['master'].lastProcessed).toBe(baseHash);
expect(state['diff']['master'].lastProcessed).toBe(diffHash);
expect(state['merged']['master'].lastProcessed).toBe(mergedHash);

// expect(state['base']['master'].committedByDiflow).toBe([]);
// expect(state['diff']['master'].committedByDiflow).toBe([]);
// expect(state['merged']['master'].committedByDiflow).toBe([]);
expect(state['base']['master'].committedByDiflow).toEqual([]);
expect(state['diff']['master'].committedByDiflow).toEqual([]);
expect(state['merged']['master'].committedByDiflow).toEqual([]);
}

0 comments on commit e57e097

Please sign in to comment.