-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(@angular/cli): Determine relative paths correctly
As `git status --porcelain` always shows paths relative to the top level, fetch the top level path in `checkCleanGit` and properly determine whether any modified files are actually within the Angular workspace root.
- Loading branch information
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
tests/legacy-cli/e2e/tests/misc/update-git-clean-subdirectory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { createDir, writeFile } from '../../utils/fs'; | ||
import { expectToFail } from '../../utils/utils'; | ||
import { getGlobalVariable } from '../../utils/env'; | ||
import { ng, silentGit } from '../../utils/process'; | ||
import { prepareProjectForE2e } from '../../utils/project' | ||
|
||
export default async function() { | ||
process.chdir(getGlobalVariable('tmp-root')); | ||
|
||
await createDir('./subdirectory'); | ||
process.chdir('./subdirectory'); | ||
|
||
await silentGit('init', '.'); | ||
|
||
await ng('new', 'subdirectory-test-project', '--skip-install'); | ||
process.chdir('./subdirectory-test-project'); | ||
await prepareProjectForE2e('subdirectory-test-project'); | ||
|
||
await writeFile('../added.ts', 'console.log(\'created\');\n'); | ||
await silentGit('add', '../added.ts'); | ||
|
||
const { message } = await expectToFail(() => ng('update', '--all')); | ||
if (message && message.includes('Repository is not clean.')) { | ||
throw new Error('Expected clean repository'); | ||
} | ||
} |