{"thread":{"id":"18620","subject":"[PATCH] import-zips: fix thinko","startedAt":"2009-03-29T20:42:27Z","lastAt":"2009-03-29T20:42:27Z","messageCount":1,"participants":["Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"109787","messageId":"a66d575d61ccfe945467eed58fdb80a6b8350f5a.1238359324u.git.johannes.schindelin@gmx.de","threadId":"18620","inReplyTo":"cover.1238359324u.git.johannes.schindelin@gmx.de","subject":"[PATCH] import-zips: fix thinko","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-03-29T20:42:27Z","receivedAt":"2009-03-29T20:42:27Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Embarrassingly, the common prefix calculation did not work properly, due\nto a mistake in the assignment: instead of assigning the dirname of the\ncurrent file name, the dirname of the current common prefix needs to\nbe assigned to common prefix, when the current prefix does not match the\ncurrent file name.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/fast-import/import-zips.py |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/fast-import/import-zips.py b/contrib/fast-import/import-zips.py\nindex c674fa2..7051a83 100755\n--- a/contrib/fast-import/import-zips.py\n+++ b/contrib/fast-import/import-zips.py\n@@ -44,7 +44,8 @@ for zipfile in argv[1:]:\n \t\t\tcommon_prefix = name[:name.rfind('/') + 1]\n \t\telse:\n \t\t\twhile not name.startswith(common_prefix):\n-\t\t\t\tcommon_prefix = name[:name.rfind('/') + 1]\n+\t\t\t\tlast_slash = common_prefix[:-1].rfind('/') + 1\n+\t\t\t\tcommon_prefix = common_prefix[:last_slash]\n \n \t\tmark[name] = ':' + str(next_mark)\n \t\tnext_mark += 1\n-- \n1.6.2.1.493.g67cf3\n"}]}