X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=contrib%2Ffast-import%2Fimport-zips.py;h=7051a83a59758277dd60fe026dea730eb7b6b115;hb=b7fba061e05d16fd2c61db5c279b6ad4db98aba4;hp=c674fa2d1b5c6ab47ebb5e828c427c6d47bb50fc;hpb=39a76bdd7de18b2bb2651dcb8136563df41e84f7;p=git.git diff --git a/contrib/fast-import/import-zips.py b/contrib/fast-import/import-zips.py index c674fa2d1..7051a83a5 100755 --- a/contrib/fast-import/import-zips.py +++ b/contrib/fast-import/import-zips.py @@ -44,7 +44,8 @@ for zipfile in argv[1:]: common_prefix = name[:name.rfind('/') + 1] else: while not name.startswith(common_prefix): - common_prefix = name[:name.rfind('/') + 1] + last_slash = common_prefix[:-1].rfind('/') + 1 + common_prefix = common_prefix[:last_slash] mark[name] = ':' + str(next_mark) next_mark += 1