X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=contrib%2Ffast-import%2Fimport-zips.py;h=82f5ed3ddc8adb1b9b281c3912f4e67c53ef152f;hb=f9bdf9b2102bd848c7a3eabff2ba5af63828de54;hp=c674fa2d1b5c6ab47ebb5e828c427c6d47bb50fc;hpb=6e13921b4f7adcc7316a76c0c4955b85b1589a65;p=git.git diff --git a/contrib/fast-import/import-zips.py b/contrib/fast-import/import-zips.py index c674fa2d1..82f5ed3dd 100755 --- a/contrib/fast-import/import-zips.py +++ b/contrib/fast-import/import-zips.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python ## zip archive frontend for git-fast-import ## @@ -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