File tree Expand file tree Collapse file tree 2 files changed +32
-13
lines changed Expand file tree Collapse file tree 2 files changed +32
-13
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ def extract_status(value):
64
64
branch.head
65
65
[\W]+
66
66
(?P<branch_head>
67
- [\w-]*
67
+ [/. \w-]*
68
68
)
69
69
70
70
)?
@@ -74,7 +74,7 @@ def extract_status(value):
74
74
branch.upstream
75
75
[\W]+
76
76
(?P<branch_upstream>
77
- [/\w-]*
77
+ [/. \w-]*
78
78
)
79
79
)?
80
80
(
@@ -301,17 +301,20 @@ def update_repo(self):
301
301
# Pull changes from the remote branch
302
302
try :
303
303
process = self .run (['rebase' , git_remote_name + '/' + git_tag ])
304
- except exc .CommandError :
305
- # Rebase failed: Restore previous state.
306
- self .run (['rebase' , '--abort' ])
307
- if need_stash :
308
- self .run (['stash' , 'pop' , '--index' , '--quiet' ])
309
-
310
- self .error (
311
- "\n Failed to rebase in: '%s'.\n "
312
- "You will have to resolve the conflicts manually" % self .path
313
- )
314
- return
304
+ except exc .CommandError as e :
305
+ if 'invalid_upstream' in str (e ):
306
+ self .error (e )
307
+ else :
308
+ # Rebase failed: Restore previous state.
309
+ self .run (['rebase' , '--abort' ])
310
+ if need_stash :
311
+ self .run (['stash' , 'pop' , '--index' , '--quiet' ])
312
+
313
+ self .error (
314
+ "\n Failed to rebase in: '%s'.\n "
315
+ "You will have to resolve the conflicts manually" % self .path
316
+ )
317
+ return
315
318
316
319
if need_stash :
317
320
try :
Original file line number Diff line number Diff line change @@ -287,6 +287,22 @@ def test_extract_status():
287
287
'# branch.upstream moo/origin/myslash/remote' ,
288
288
{"branch_upstream" : 'moo/origin/myslash/remote' },
289
289
],
290
+ [
291
+ """
292
+ # branch.oid c3c5323abc5dca78d9bdeba6c163c2a37b452e69
293
+ # branch.head libvcs-0.4.0
294
+ # branch.upstream origin/libvcs-0.4.0
295
+ # branch.ab +0 -0
296
+ """ ,
297
+ {
298
+ "branch_oid" : 'c3c5323abc5dca78d9bdeba6c163c2a37b452e69' ,
299
+ "branch_head" : 'libvcs-0.4.0' ,
300
+ "branch_upstream" : 'origin/libvcs-0.4.0' ,
301
+ "branch_ab" : '+0 -0' ,
302
+ "branch_ahead" : '0' ,
303
+ "branch_behind" : '0' ,
304
+ },
305
+ ],
290
306
],
291
307
)
292
308
def test_extract_status_b (fixture , expected_result ):
You can’t perform that action at this time.
0 commit comments