@@ -719,16 +719,17 @@ export class GitExtension implements IGitExtension {
719
719
const tid = this . _addTask ( 'git:refresh:branches' ) ;
720
720
try {
721
721
const response = await this . _branch ( ) ;
722
- if ( response . code === 0 ) {
723
- this . _branches = response . branches ;
724
- this . _currentBranch = response . current_branch ;
725
- if ( this . _currentBranch ) {
726
- // Set up the marker obj for the current (valid) repo/branch combination
727
- this . _setMarker ( this . pathRepository , this . _currentBranch . name ) ;
728
- }
729
- } else {
730
- this . _branches = [ ] ;
731
- this . _currentBranch = null ;
722
+ this . _branches = response . branches ;
723
+ this . _currentBranch = response . current_branch ;
724
+ if ( this . _currentBranch ) {
725
+ // Set up the marker obj for the current (valid) repo/branch combination
726
+ this . _setMarker ( this . pathRepository , this . _currentBranch . name ) ;
727
+ }
728
+ } catch ( error ) {
729
+ this . _branches = [ ] ;
730
+ this . _currentBranch = null ;
731
+ if ( ! ( error instanceof Git . NotInRepository ) ) {
732
+ throw error ;
732
733
}
733
734
} finally {
734
735
this . _removeTask ( tid ) ;
@@ -743,13 +744,17 @@ export class GitExtension implements IGitExtension {
743
744
async refreshStatus ( ) : Promise < void > {
744
745
let data : Git . IStatusResult ;
745
746
746
- await this . ready ;
747
-
748
- const path = this . pathRepository ;
749
- if ( path === null ) {
747
+ let path : string ;
748
+ try {
749
+ path = await this . _getPathRespository ( ) ;
750
+ } catch ( error ) {
750
751
this . _setStatus ( [ ] ) ;
751
- return Promise . resolve ( ) ;
752
+ if ( ! ( error instanceof Git . NotInRepository ) ) {
753
+ throw error ;
754
+ }
755
+ return ;
752
756
}
757
+
753
758
const tid = this . _addTask ( 'git:refresh:status' ) ;
754
759
try {
755
760
data = await requestAPI < Git . IStatusResult > ( 'status' , 'POST' , {
0 commit comments