1
0
mirror of https://github.com/git/git.git synced 2024-09-28 16:13:01 +02:00

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>
This commit is contained in:
Johannes Schindelin 2009-03-29 22:42:27 +02:00 committed by Junio C Hamano
parent e8bd78c3fc
commit 63801da88d

@ -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