Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2db87ca

Browse files
committed
correctly exit when github repo can't be found
There has to be a remote origin at github for fetching
1 parent 12106c6 commit 2db87ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

git-pull-request

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ def main():
5555
origin = os.popen('git remote -v').read()
5656
m = re.search('^origin.*?github\.com.*?[:/]([^/]+/[^/]+)\.git\s*\(fetch\)$',origin,re.MULTILINE)
5757
if(m == None or m.group(1) == ''):
58-
print color_text("Failed to determine repo name from origin",'red',True)
58+
print color_text("Failed to determine github repo name from origin",'red',True)
59+
sys.exit(1)
5960
repo = m.group(1)
6061

6162
# process arguments

0 commit comments

Comments
 (0)