summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2009-03-29 20:42:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-03-30 02:56:26 (GMT)
commit63801da88d8638eb6cf26d6305a721ad3731e216 (patch)
tree9440c1c2fc847ed7841446ef627dc0f51c1575a1 /contrib
parente8bd78c3fcba35b8344ea6bab6218b793e507ea3 (diff)
downloadgit-63801da88d8638eb6cf26d6305a721ad3731e216.zip
git-63801da88d8638eb6cf26d6305a721ad3731e216.tar.gz
git-63801da88d8638eb6cf26d6305a721ad3731e216.tar.bz2
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>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/fast-import/import-zips.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/fast-import/import-zips.py b/contrib/fast-import/import-zips.py
index c674fa2..7051a83 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