diff options
author | Guido Günther <agx@sigxcpu.org> | 2019-10-26 12:02:30 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2019-10-26 12:02:30 +0200 |
commit | 62485247b61090f8bd41a8bf419872db36fa12dc (patch) | |
tree | 18f75f70d862e471598b295fbb0cc1624932a601 /gbp | |
parent | d21627cb031a38b3d9a052e2d931853f04fb8fff (diff) |
export_orig: Don't fail without a repository
This is a valid use case in overlay mode
Thanks: Thomas Koch for the report
Diffstat (limited to 'gbp')
-rwxr-xr-x | gbp/scripts/export_orig.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gbp/scripts/export_orig.py b/gbp/scripts/export_orig.py index c2885014..13be4f91 100755 --- a/gbp/scripts/export_orig.py +++ b/gbp/scripts/export_orig.py @@ -236,12 +236,13 @@ def guess_comp_type(comp_type, source, repo, tarball_dir): if comp_type == 'auto': branch = None - if repo.has_branch('pristine-tar'): - branch = 'pristine-tar' - elif repo.has_branch('origin/pristine-tar', remote=True): - branch = 'origin/pristine-tar' + if repo: + if repo.has_branch('pristine-tar'): + branch = 'pristine-tar' + elif repo.has_branch('origin/pristine-tar', remote=True): + branch = 'origin/pristine-tar' - if branch: + if branch is not None: regex = r'pristine-tar .* %s_%s\.orig.tar\.' % (source.name, source.upstream_version) commits = repo.grep_log(regex, branch, merges=False) if commits: |