From d5c34b55fca0868442711040adb6e5cda9cde653 Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Wed, 19 Jan 2022 22:11:26 +0000 Subject: Simplify raw-file-importer argument parsing We always pass the relative path, drop support for optionally passing it. --- lorry.raw-file-importer | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'lorry.raw-file-importer') diff --git a/lorry.raw-file-importer b/lorry.raw-file-importer index caaa8c9..de35e58 100755 --- a/lorry.raw-file-importer +++ b/lorry.raw-file-importer @@ -60,10 +60,7 @@ def commit_lfs_file(raw_file, relative_path, last_commit, fast_import): # Commit the data to master commit_time = int(time.time()) basename = os.path.basename(raw_file) - if relative_path: - path = '{}/{}'.format(relative_path, basename) - else: - path = basename + path = '{}/{}'.format(relative_path, basename) fromline = 'from {}\n'.format(last_commit) if last_commit else '' @@ -104,15 +101,12 @@ def get_last_commit(): def main(): - if len(sys.argv) < 2 or len(sys.argv) > 3: - print('usage:', sys.argv[0], '', '[]') + if len(sys.argv) != 3: + print('usage:', sys.argv[0], '', '') sys.exit(1) raw_file = sys.argv[1] - if len(sys.argv) < 3: - relpath = None - else: - relpath = sys.argv[2] + relpath = sys.argv[2] last_commit = get_last_commit() with subprocess.Popen('git fast-import --quiet', shell=True, -- cgit v1.2.1