Don’t fail if there’s no pristine-lfs branch

Signed-off-by: Andrej Shadura's avatarAndrej Shadura <andrew.shadura@collabora.co.uk>
parent 0bb24d62
......@@ -12,7 +12,7 @@
#
from fnmatch import fnmatch
import sys
from pristine_lfs.util import check_branch, track_remote_branch, checkout_lfs_file, list_lfs_files
from pristine_lfs.util import check_branch, track_remote_branch, checkout_lfs_file, list_lfs_files, find_remote_branches
from sh import mv
from debian.changelog import Changelog
......@@ -25,7 +25,11 @@ def main():
tarball_glob = '{0.package}_{0.version.upstream_version}.orig.tar.*'.format(ch)
component_tarball_glob = '{0.package}_{0.version.upstream_version}.orig-*.tar.*'.format(ch)
if check_branch(metadata_branch) is None:
track_remote_branch(metadata_branch)
if find_remote_branches(metadata_branch):
track_remote_branch(metadata_branch)
else:
print("Skipped.", file=sys.stderr)
return
files = list_lfs_files(metadata_branch)
tarballs = [f for f in files if fnmatch(f, tarball_glob) or fnmatch(f, component_tarball_glob)]
for f in tarballs:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment