Skip to content

Commit

Permalink
If we've already fetched, we don't need to refetch
Browse files Browse the repository at this point in the history
  • Loading branch information
natecavanaugh committed Dec 23, 2014
1 parent 865c638 commit f703be3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion git-pull-request/git-pull-request.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,14 @@ def fetch_pull_request(pull_request, repo_name):

remote_branch_name = 'refs/pull/%s/head' % pull_request['number']

ret = os.system('git fetch %s "%s":%s' % (repo_url, remote_branch_name, branch_name))
ret = os.system('git show-ref --verify -q refs/heads/%s' % branch_name)
# sha = os.popen('git rev-parse --abbrev-ref refs/heads/%s' % branch_name).read().strip()

# log(pull_request)

if ret != 0:
ret = os.system('git fetch %s "%s":%s' % (repo_url, remote_branch_name, branch_name))


if ret != 0:
ret = os.system('git show-ref --verify refs/heads/%s' % branch_name)
Expand Down

0 comments on commit f703be3

Please sign in to comment.