Skip to content

Commit 52ee784

Browse files
authored
Merge pull request #59 from cksource/t/58
Fix: Not staged, deleted files were not shown as modified during mgit status command. Closes #58.
2 parents 0351bbc + 7082c3d commit 52ee784

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

lib/utils/gitstatusparser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = function gitStatusParser( response ) {
3434

3535
const branch = branchData.split( '...' )[ 0 ].match( /## (.*)$/ )[ 1 ];
3636
const added = findFiles( [ ADDED_STAGED_SYMBOL ] );
37-
const modified = findFiles( [ MODIFIED_NOT_STAGED_SYMBOL, MODIFIED_STAGED_AND_NOT_STAGED_SYMBOL ] );
37+
const modified = findFiles( [ MODIFIED_NOT_STAGED_SYMBOL, MODIFIED_STAGED_AND_NOT_STAGED_SYMBOL, DELETE_NOT_STAGED_SYMBOL ] );
3838
const deleted = findFiles( [ DELETE_STAGED_SYMBOL, DELETE_NOT_STAGED_SYMBOL ] );
3939
const renamed = findFiles( [ RENAMED_STAGED_SYMBOL ] );
4040
const unmerged = findFiles( UNMERGED_SYMBOLS );

tests/utils/gitstatusparser.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ describe( 'utils', () => {
6363
const status = gitStatusParser( gitStatusResponse );
6464

6565
expect( status.modified ).to.deep.equal( [
66+
'README.txt',
6667
'lib/index.js',
67-
'lib/tasks/logger.js'
68+
'lib/tasks/logger.js',
69+
'lib/tasks/.gitkeep'
6870
] );
6971
} );
7072

0 commit comments

Comments
 (0)