Skip to content

Commit 63801da

Browse files
dschogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e8bd78c commit 63801da

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

contrib/fast-import/import-zips.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def printlines(list):
4444
common_prefix = name[:name.rfind('/') + 1]
4545
else:
4646
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]
4849

4950
mark[name] = ':' + str(next_mark)
5051
next_mark += 1

0 commit comments

Comments
 (0)