From 3a3fe671e99214948bc4d1bed7c58cfe1df33b1a Mon Sep 17 00:00:00 2001 From: Holger Dell Date: Wed, 4 Jun 2014 00:16:47 -0500 Subject: [PATCH] mangle_path: verify chunked name refers to git dir 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 [rlb@defaultvalue.org: adjust commit message] Reviewed-by: Rob Browning --- lib/bup/git.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/bup/git.py b/lib/bup/git.py index 82cd787..76145a4 100644 --- a/lib/bup/git.py +++ b/lib/bup/git.py @@ -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' -- 2.39.2