summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlorry.raw-file-importer14
1 files changed, 4 insertions, 10 deletions
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], '<file>', '[<relative path>]')
+ if len(sys.argv) != 3:
+ print('usage:', sys.argv[0], '<file>', '<relative path>')
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,