From 6d58d372a7a1a37e01399d6d1fe38ceb4f60ea44 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 29 Dec 2020 23:28:34 +0100 Subject: [PATCH] get: remove pointless git.repo() call There's no point in doing "opt.source or git.repo()" since we just pass the result to LocalRepo(), which already does exactly the same thing. Remove the src_dir variable entirely. Signed-off-by: Johannes Berg --- lib/cmd/get-cmd.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/cmd/get-cmd.py b/lib/cmd/get-cmd.py index 4880cbf..7fc741e 100755 --- a/lib/cmd/get-cmd.py +++ b/lib/cmd/get-cmd.py @@ -587,7 +587,6 @@ def main(): git.check_repo_or_die() if opt.source: opt.source = argv_bytes(opt.source) - src_dir = opt.source or git.repo() if opt.bwlimit: client.bwlimit = parse_num(opt.bwlimit) if is_reverse and opt.remote: @@ -600,7 +599,7 @@ def main(): dest_repo = LocalRepo() with dest_repo as dest_repo: - with LocalRepo(repo_dir=src_dir) as src_repo: + with LocalRepo(repo_dir=opt.source) as src_repo: with dest_repo.new_packwriter(compression_level=opt.compress) as writer: # Resolve and validate all sources and destinations, # implicit or explicit, and do it up-front, so we can -- 2.39.2