]> arthur.barton.de Git - bup.git/commitdiff
mangle_path: verify chunked name refers to git dir
authorHolger Dell <github@holgerdell.com>
Wed, 4 Jun 2014 05:16:47 +0000 (00:16 -0500)
committerRob Browning <rlb@defaultvalue.org>
Wed, 4 Jun 2014 18:35:39 +0000 (13:35 -0500)
Before returning the mangled name.bup for a chunked item, ensure that
the name really does refer to a dir in the git tree via asssert.

Signed-off-by: Holger Dell <github@holgerdell.com>
[rlb@defaultvalue.org: adjust commit message]
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/git.py

index 82cd787c8ee7f148601747b673d4088bc5f6935e..76145a45c5a3dc0cda20aa4a9bfbd2f867b3cd82 100644 (file)
@@ -152,6 +152,7 @@ def mangle_name(name, mode, gitmode):
     disambiguate normal files from segmented ones.
     """
     if stat.S_ISREG(mode) and not stat.S_ISREG(gitmode):
+        assert(stat.S_ISDIR(gitmode))
         return name + '.bup'
     elif name.endswith('.bup') or name[:-1].endswith('.bup'):
         return name + '.bupl'