@@ -75,43 +75,42 @@ const textDecoder = new TextDecoder('utf8');
7575const rootSha = '4b825dc642cb6eb9a060e54bf8d69288fbee4904' ;
7676
7777export const GitErrors = {
78+ alreadyCheckedOut : / a l r e a d y c h e c k e d o u t / i,
79+ alreadyExists : / a l r e a d y e x i s t s / i,
80+ ambiguousArgument : / f a t a l : \s * a m b i g u o u s a r g u m e n t [ ' " ] .+ [ ' " ] : u n k n o w n r e v i s i o n o r p a t h n o t i n t h e w o r k i n g t r e e / i,
7881 badRevision : / b a d r e v i s i o n ' ( .* ?) ' / i,
7982 cantLockRef : / c a n n o t l o c k r e f | u n a b l e t o u p d a t e l o c a l r e f / i,
80- changesWouldBeOverwritten : / Y o u r l o c a l c h a n g e s t o t h e f o l l o w i n g f i l e s w o u l d b e o v e r w r i t t e n / i,
83+ changesWouldBeOverwritten : / e r r o r : \s * Y o u r l o c a l c h a n g e s t o t h e f o l l o w i n g f i l e s w o u l d b e o v e r w r i t t e n / i,
8184 commitChangesFirst : / P l e a s e , c o m m i t y o u r c h a n g e s b e f o r e y o u c a n / i,
8285 conflict : / ^ C O N F L I C T \( [ ^ ) ] + \) : \b / m,
86+ entryNotUpToDate : / e r r o r : \s * E n t r y [ ' " ] .+ [ ' " ] n o t u p t o d a t e \. C a n n o t m e r g e \. / i,
8387 failedToDeleteDirectoryNotEmpty : / f a i l e d t o d e l e t e ' ( .* ?) ' : D i r e c t o r y n o t e m p t y / i,
88+ invalidLineCount : / f i l e .+ ? h a s o n l y \d + l i n e s / i,
8489 invalidObjectName : / i n v a l i d o b j e c t n a m e : ( .* ) \s / i,
8590 invalidObjectNameList : / c o u l d n o t o p e n o b j e c t n a m e l i s t : ( .* ) \s / i,
91+ invalidTagName : / i n v a l i d t a g n a m e / i,
92+ mainWorkingTree : / i s a m a i n w o r k i n g t r e e / i,
8693 noFastForward : / \( n o n - f a s t - f o r w a r d \) / i,
8794 noMergeBase : / n o m e r g e b a s e / i,
8895 noRemoteRepositorySpecified : / N o r e m o t e r e p o s i t o r y s p e c i f i e d \. / i,
96+ noUpstream : / ^ f a t a l : T h e c u r r e n t b r a n c h .* h a s n o u p s t r e a m b r a n c h / i,
97+ noUserNameConfigured : / P l e a s e t e l l m e w h o y o u a r e \. / i,
8998 notAValidObjectName : / N o t a v a l i d o b j e c t n a m e / i,
9099 notAWorkingTree : / ' ( .* ?) ' i s n o t a w o r k i n g t r e e / i,
91- noUserNameConfigured : / P l e a s e t e l l m e w h o y o u a r e \. / i,
92- invalidLineCount : / f i l e .+ ? h a s o n l y \d + l i n e s / i,
93- uncommittedChanges : / c o n t a i n s m o d i f i e d o r u n t r a c k e d f i l e s / i,
94- alreadyExists : / a l r e a d y e x i s t s / i,
95- alreadyCheckedOut : / a l r e a d y c h e c k e d o u t / i,
96- mainWorkingTree : / i s a m a i n w o r k i n g t r e e / i,
97- noUpstream : / ^ f a t a l : T h e c u r r e n t b r a n c h .* h a s n o u p s t r e a m b r a n c h / i,
98100 permissionDenied : / P e r m i s s i o n .* d e n i e d / i,
99101 pushRejected : / ^ e r r o r : f a i l e d t o p u s h s o m e r e f s t o \b / m,
100102 rebaseMultipleBranches : / c a n n o t r e b a s e o n t o m u l t i p l e b r a n c h e s / i,
103+ refLocked : / f a t a l : \s * c a n n o t l o c k r e f [ ' " ] .+ [ ' " ] : u n a b l e t o c r e a t e f i l e / i,
101104 remoteAhead : / r e j e c t e d b e c a u s e t h e r e m o t e c o n t a i n s w o r k / i,
102105 remoteConnection : / C o u l d n o t r e a d f r o m r e m o t e r e p o s i t o r y / i,
103- tagConflict : / ! \[ r e j e c t e d \] .* \( w o u l d c l o b b e r e x i s t i n g t a g \) / m,
104- unmergedFiles : / i s n o t p o s s i b l e b e c a u s e y o u h a v e u n m e r g e d f i l e s / i,
105- unstagedChanges : / Y o u h a v e u n s t a g e d c h a n g e s / i,
106+ remoteRejected : / r e j e c t e d b e c a u s e t h e r e m o t e c o n t a i n s w o r k / i,
106107 tagAlreadyExists : / t a g .* a l r e a d y e x i s t s / i,
108+ tagConflict : / ! \[ r e j e c t e d \] .* \( w o u l d c l o b b e r e x i s t i n g t a g \) / m,
107109 tagNotFound : / t a g .* n o t f o u n d / i,
108- invalidTagName : / i n v a l i d t a g n a m e / i,
109- remoteRejected : / r e j e c t e d b e c a u s e t h e r e m o t e c o n t a i n s w o r k / i,
110+ uncommittedChanges : / c o n t a i n s m o d i f i e d o r u n t r a c k e d f i l e s / i,
110111 unmergedChanges : / e r r o r : \s * y o u n e e d t o r e s o l v e y o u r c u r r e n t i n d e x f i r s t / i,
111- ambiguousArgument : / f a t a l : \s * a m b i g u o u s a r g u m e n t [ ' " ] .+ [ ' " ] : u n k n o w n r e v i s i o n o r p a t h n o t i n t h e w o r k i n g t r e e / i,
112- entryNotUpToDate : / e r r o r : \s * E n t r y [ ' " ] .+ [ ' " ] n o t u p t o d a t e \. C a n n o t m e r g e \. / i,
113- changesWouldBeOverwritten : / e r r o r : \s * Y o u r l o c a l c h a n g e s t o t h e f o l l o w i n g f i l e s w o u l d b e o v e r w r i t t e n / i,
114- refLocked : / f a t a l : \s * c a n n o t l o c k r e f [ ' " ] .+ [ ' " ] : u n a b l e t o c r e a t e f i l e / i,
112+ unmergedFiles : / i s n o t p o s s i b l e b e c a u s e y o u h a v e u n m e r g e d f i l e s / i,
113+ unstagedChanges : / Y o u h a v e u n s t a g e d c h a n g e s / i,
115114} ;
116115
117116const GitWarnings = {
@@ -180,12 +179,11 @@ const tagErrorAndReason: [RegExp, TagErrorReason][] = [
180179 [ GitErrors . remoteRejected , TagErrorReason . RemoteRejected ] ,
181180] ;
182181
183- const resetErrorAndReason = [
184- [ unmergedChanges , ResetErrorReason . UnmergedChanges ] ,
185- [ ambiguousArgument , ResetErrorReason . AmbiguousArgument ] ,
186- [ entryNotUpToDate , ResetErrorReason . EntryNotUpToDate ] ,
187- [ changesWouldBeOverwritten , ResetErrorReason . LocalChangesWouldBeOverwritten ] ,
188- [ refLocked , ResetErrorReason . RefLocked ] ,
182+ const resetErrorAndReason : [ RegExp , ResetErrorReason ] [ ] = [
183+ [ GitErrors . unmergedChanges , ResetErrorReason . UnmergedChanges ] ,
184+ [ GitErrors . ambiguousArgument , ResetErrorReason . AmbiguousArgument ] ,
185+ [ GitErrors . entryNotUpToDate , ResetErrorReason . EntryNotUpToDate ] ,
186+ [ GitErrors . refLocked , ResetErrorReason . RefLocked ] ,
189187] ;
190188
191189export class Git {
@@ -1599,9 +1597,9 @@ export class Git {
15991597 return this . git < string > ( { cwd : repoPath } , 'remote' , 'get-url' , remote ) ;
16001598 }
16011599
1602- reset ( repoPath : string , pathspecs : string [ ] , ...args : string [ ] ) {
1600+ async reset ( repoPath : string , pathspecs : string [ ] , ...args : string [ ] ) {
16031601 try {
1604- return this . git < string > ( { cwd : repoPath } , 'reset' , '-q' , ...args , '--' , ...pathspecs ) ;
1602+ await this . git < string > ( { cwd : repoPath } , 'reset' , '-q' , ...args , '--' , ...pathspecs ) ;
16051603 } catch ( ex ) {
16061604 const msg : string = ex ?. toString ( ) ?? '' ;
16071605 for ( const [ error , reason ] of resetErrorAndReason ) {
0 commit comments