From: itxx00 Date: Wed, 8 Jan 2014 05:14:26 +0000 (+0800) Subject: bup-restore.md: always initialize root_meta in do_root. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=6945ee1f15a897b2a762367e8f568af0451761af;p=packages%2Fb%2Fbup.git bup-restore.md: always initialize root_meta in do_root. Previously, using bup split with bup restore would cause an error: UnboundLocalError: local variable 'root_meta' referenced before assignment Signed-off-by: itxx00 [rlb@defaultvalue.org: adjust commit message. Initialize root_meta unconditionally before guard to match other code.] Signed-off-by: Rob Browning --- diff --git a/cmd/restore-cmd.py b/cmd/restore-cmd.py index db6def7..158a707 100755 --- a/cmd/restore-cmd.py +++ b/cmd/restore-cmd.py @@ -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)