]> arthur.barton.de Git - bup.git/commitdiff
bup-restore.md: always initialize root_meta in do_root.
authoritxx00 <itxx00@gmail.com>
Wed, 8 Jan 2014 05:14:26 +0000 (13:14 +0800)
committerRob Browning <rlb@defaultvalue.org>
Tue, 14 Jan 2014 17:14:17 +0000 (11:14 -0600)
Previously, using bup split with bup restore would cause an error:

  UnboundLocalError: local variable 'root_meta' referenced before assignment

Signed-off-by: itxx00 <itxx00@gmail.com>
[rlb@defaultvalue.org: adjust commit message.  Initialize root_meta
 unconditionally before guard to match other code.]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
cmd/restore-cmd.py

index db6def75989bbe970524b8e4b1b86071160c9150..158a707a8532210fb7246b6a1ad6de67816c852a 100755 (executable)
@@ -196,6 +196,7 @@ def do_root(n, owner_map, restore_root_meta = True):
         # Directory metadata is the first entry in any .bupm file in
         # the directory.  Get it.
         mfile = n.metadata_file() # VFS file -- cannot close().
+        root_meta = None
         if mfile:
             meta_stream = mfile.open()
             root_meta = metadata.Metadata.read(meta_stream)