From: Johannes Schindelin Date: Sun, 29 Mar 2009 20:42:27 +0000 (+0200) Subject: import-zips: fix thinko X-Git-Tag: v1.6.2.2~7^2~2^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=63801da88d8638eb6cf26d6305a721ad3731e216;p=git.git 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 Signed-off-by: Junio C Hamano --- 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