allow get_patches to work with explicit refs
This commit is contained in:
parent
672244a433
commit
554460811e
|
@ -110,12 +110,12 @@ def get_current_project():
|
|||
return api.project.get(project_id)
|
||||
|
||||
|
||||
def get_patches(number_of_commits=0):
|
||||
def get_patches(number_of_commits=0, ref=None):
|
||||
repo = get_repo()
|
||||
tempdir = tempfile.mkdtemp()
|
||||
if number_of_commits:
|
||||
ref = 'HEAD' + '~' * number_of_commits
|
||||
else:
|
||||
elif not ref:
|
||||
ref = '@{upstream}'
|
||||
repo.git.format_patch(ref, o=tempdir)
|
||||
|
||||
|
|
Loading…
Reference in New Issue