diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 8810fff7dcf27..31366834f7f99 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -1,6 +1,9 @@ name: Unit tests on: + push: + branches: + - main pull_request: branches: ['*'] types: diff --git a/src/git/models/fileStatus.ts b/src/git/models/fileStatus.ts index c02b749cd6060..8c912c055965d 100644 --- a/src/git/models/fileStatus.ts +++ b/src/git/models/fileStatus.ts @@ -12,6 +12,7 @@ export const enum GitFileConflictStatus { export const enum GitFileIndexStatus { Modified = 'M', + TypeChanged = 'T', Added = 'A', Deleted = 'D', Renamed = 'R', diff --git a/src/git/models/statusFile.ts b/src/git/models/statusFile.ts index 407b73d2c3109..b430d2e65e675 100644 --- a/src/git/models/statusFile.ts +++ b/src/git/models/statusFile.ts @@ -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; diff --git a/src/git/parsers/__tests__/diffParser.test.ts b/src/git/parsers/__tests__/diffParser.test.ts index 43b20af4a221d..1e685f76c72f0 100644 --- a/src/git/parsers/__tests__/diffParser.test.ts +++ b/src/git/parsers/__tests__/diffParser.test.ts @@ -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'); }); diff --git a/src/git/parsers/diffParser.ts b/src/git/parsers/diffParser.ts index 51e939f57e548..860074469b685 100644 --- a/src/git/parsers/diffParser.ts +++ b/src/git/parsers/diffParser.ts @@ -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; diff --git a/tests/docker/run-e2e-test-local.sh b/tests/docker/run-e2e-test-local.sh index 40925fc6fa370..fa5be6d6111bf 100755 --- a/tests/docker/run-e2e-test-local.sh +++ b/tests/docker/run-e2e-test-local.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e docker build . -t e2e-test diff --git a/tests/docker/run-unit-tests.sh b/tests/docker/run-unit-tests.sh index 7fda786ee9bfd..642698950de40 100755 --- a/tests/docker/run-unit-tests.sh +++ b/tests/docker/run-unit-tests.sh @@ -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`;