]> arthur.barton.de Git - bup.git/commitdiff
index: restore print format of octal mode and gitmode
authorRob Browning <rlb@defaultvalue.org>
Sun, 14 Aug 2022 18:29:09 +0000 (13:29 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 14 Aug 2022 19:07:55 +0000 (14:07 -0500)
Since python 3 changed oct() to add a 0o prefix.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/cmd/index.py

index 9bc4f2a5eb99429117f241c342deab8b53bd9a90..2f8c608118f6da3f9fa507e8fa6df338e9c52054 100644 (file)
@@ -308,8 +308,7 @@ def main(argv):
                 if opt.hash:
                     line += hexlify(ent.sha) + b' '
                 if opt.long:
-                    line += b'%7s %7s ' % (oct(ent.mode).encode('ascii'),
-                                           oct(ent.gitmode).encode('ascii'))
+                    line += f'{ent.mode:07o} {ent.gitmode:07o} '.encode('ascii')
                 out.write(line + (name or b'./') + b'\n')
 
     if opt.check and (opt['print'] or opt.status or opt.modified or opt.update):