Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Unit tests

on:
push:
branches:
- main
pull_request:
branches: ['*']
types:
Expand Down
1 change: 1 addition & 0 deletions src/git/models/fileStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const enum GitFileConflictStatus {

export const enum GitFileIndexStatus {
Modified = 'M',
TypeChanged = 'T',
Added = 'A',
Deleted = 'D',
Renamed = 'R',
Expand Down
3 changes: 3 additions & 0 deletions src/git/models/statusFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ export class GitStatusFile implements GitFile {
case 'M':
this.indexStatus = GitFileIndexStatus.Modified;
break;
case 'T':
this.indexStatus = GitFileIndexStatus.TypeChanged;
break;
case 'R':
this.indexStatus = GitFileIndexStatus.Renamed;
break;
Expand Down
2 changes: 1 addition & 1 deletion src/git/parsers/__tests__/diffParser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ index 0000000..abc123

const file = result.files[0];
assert.strictEqual(file.path, 'new-file.ts', 'Should have correct path');
assert.strictEqual(file.originalPath, undefined, 'Should have no original path');
assert.strictEqual(file.originalPath, 'dev/null', 'Should have no original path');
assert.strictEqual(file.status, 'A', 'Should have added status');
assert.strictEqual(file.hunks.length, 0, 'Should have no hunks without @@ markers');
});
Expand Down
2 changes: 1 addition & 1 deletion src/git/parsers/diffParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function parseFileStatusAndMetadata(
} else if (binary) {
status = path !== originalPath ? GitFileIndexStatus.Renamed : GitFileIndexStatus.Modified;
} else if (modeChange && !hasHunks) {
status = GitFileIndexStatus.Modified;
status = GitFileIndexStatus.TypeChanged;
} else {
// Default logic based on path comparison
status = path !== originalPath ? GitFileIndexStatus.Renamed : GitFileIndexStatus.Modified;
Expand Down
1 change: 1 addition & 0 deletions tests/docker/run-e2e-test-local.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e

docker build . -t e2e-test

Expand Down
6 changes: 5 additions & 1 deletion tests/docker/run-unit-tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
pnpm run test;
(
set -e
pnpm run pretty:check
pnpm run test
);
EXIT_CODE=$?;
if [[ "$EXIT_CODE" == "0" ]]; then
kill -s SIGINT `cat /var/run/supervisor/supervisord.pid`;
Expand Down