File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,20 @@ var StatusFile = function(args) {
8282 } ,
8383 isIgnored : function ( ) {
8484 return data . statusBit & codes . IGNORED ;
85+ } ,
86+ inWorkingTree : function ( ) {
87+ return status & codes . WT_NEW ||
88+ status & codes . WT_MODIFIED ||
89+ status & codes . WT_DELETED ||
90+ status & codes . WT_TYPECHANGE ||
91+ status & codes . WT_RENAMED ;
92+ } ,
93+ inIndex : function ( ) {
94+ return status & codes . INDEX_NEW ||
95+ status & codes . INDEX_MODIFIED ||
96+ status & codes . INDEX_DELETED ||
97+ status & codes . INDEX_TYPECHANGE ||
98+ status & codes . INDEX_RENAMED ;
8599 }
86100 } ;
87101} ;
Original file line number Diff line number Diff line change @@ -20,4 +20,9 @@ describe("StatusFile", function() {
2020 assert . ok ( this . status . isNew ( ) ) ;
2121 assert . ok ( ! this . status . isModified ( ) ) ;
2222 } ) ;
23+
24+ it ( "detects working tree and index statuses" , function ( ) {
25+ assert . ok ( this . status . inWorkingTree ( ) ) ;
26+ assert . ok ( ! this . status . inIndex ( ) ) ;
27+ } ) ;
2328} ) ;
You can’t perform that action at this time.
0 commit comments