]> arthur.barton.de Git - bup.git/commitdiff
get: remove pointless git.repo() call
authorJohannes Berg <johannes@sipsolutions.net>
Tue, 29 Dec 2020 22:28:34 +0000 (23:28 +0100)
committerRob Browning <rlb@defaultvalue.org>
Thu, 31 Dec 2020 20:35:18 +0000 (14:35 -0600)
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 <johannes@sipsolutions.net>
lib/cmd/get-cmd.py

index 4880cbf7ae66ee79ea33fd65bee657d596bcf0e2..7fc741e04db4fa6f6f61eaabbdd2aa987d2c992a 100755 (executable)
@@ -587,7 +587,6 @@ def main():
     git.check_repo_or_die()
     if opt.source:
         opt.source = argv_bytes(opt.source)
     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:
     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:
         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
             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