checkPlugin: Use `--name-status` for `git diff-index`

`--compact-sumary` is relatively new (v2.17.0), and I actually
intended to use `--name-status` anyway.
pull/4644/head
Richard Hansen 2021-01-09 17:27:51 -05:00 committed by John McLear
parent 071cca1d48
commit 6a13baf7d4
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@ const prepareRepo = () => {
execSync('git rev-parse --verify @{u}'); // Make sure there's a remote tracking branch. execSync('git rev-parse --verify @{u}'); // Make sure there's a remote tracking branch.
const dirtyFiles = execSync('git ls-files -dmo --exclude-standard'); const dirtyFiles = execSync('git ls-files -dmo --exclude-standard');
if (dirtyFiles !== '') throw new Error(`working directory is unclean:\n${dirtyFiles}`); if (dirtyFiles !== '') throw new Error(`working directory is unclean:\n${dirtyFiles}`);
const indexStatus = execSync('git diff-index --cached --compact-summary HEAD'); const indexStatus = execSync('git diff-index --cached --name-status HEAD');
if (indexStatus !== '') throw new Error(`uncommitted staged changes to files:\n${indexStatus}`); if (indexStatus !== '') throw new Error(`uncommitted staged changes to files:\n${indexStatus}`);
execSync('git pull --ff-only', {stdio: 'inherit'}); execSync('git pull --ff-only', {stdio: 'inherit'});
if (execSync('git rev-list @{u}...') !== '') throw new Error('repo contains unpushed commits'); if (execSync('git rev-list @{u}...') !== '') throw new Error('repo contains unpushed commits');