import-zips: fix thinko
Embarrassingly, the common prefix calculation did not work properly, due to a mistake in the assignment: instead of assigning the dirname of the current file name, the dirname of the current common prefix needs to be assigned to common prefix, when the current prefix does not match the current file name. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Mar 29, 2009 at 22:42 UTC
63801da88d8638eb6cf26d6305a721ad3731e216
1 file changed
+2
-1
contrib/fast-import/import-zips.py
+2
-1
@@ -44,7 +44,8 @@ for zipfile in argv[1:]:
44
common_prefix = name[:name.rfind('/') + 1]
45
else:
46
while not name.startswith(common_prefix):
47
- common_prefix = name[:name.rfind('/') + 1]
47
+ last_slash = common_prefix[:-1].rfind('/') + 1
48
+ common_prefix = common_prefix[:last_slash]
49
50
mark[name] = ':' + str(next_mark)
51
next_mark += 1