From: Johannes Schindelin Date: Sun, 23 Nov 2008 11:55:54 +0000 (+0100) Subject: fast-export: use an unsorted string list for extra_refs X-Git-Tag: v1.6.1-rc1~5^2~4^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2075ffb58e3a2d46d9e7606010f7f943f2295376;p=git.git fast-export: use an unsorted string list for extra_refs The list extra_refs contains tags and the objects referenced by them, so that they can be handled at the end. When a tag references a commit, that commit is added to the list using the same name. Also, the function handle_tags_and_duplicates() relies on the order the items were added to extra_refs, so clearly we do not want to use a sorted list here. Noticed by Miklos Vajna. Signed-off-by: Johannes Schindelin Tested-by: Miklos Vajna Signed-off-by: Junio C Hamano --- diff --git a/builtin-fast-export.c b/builtin-fast-export.c index 7c93eb878..7d5d57ad7 100644 --- a/builtin-fast-export.c +++ b/builtin-fast-export.c @@ -354,7 +354,7 @@ static void get_tags_and_duplicates(struct object_array *pending, case OBJ_TAG: tag = (struct tag *)e->item; while (tag && tag->object.type == OBJ_TAG) { - string_list_insert(full_name, extra_refs)->util = tag; + string_list_append(full_name, extra_refs)->util = tag; tag = (struct tag *)tag->tagged; } if (!tag) @@ -374,7 +374,7 @@ static void get_tags_and_duplicates(struct object_array *pending, } if (commit->util) /* more than one name for the same object */ - string_list_insert(full_name, extra_refs)->util = commit; + string_list_append(full_name, extra_refs)->util = commit; else commit->util = full_name; } diff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh index 7607a12db..638c858dc 100755 --- a/t/t9301-fast-export.sh +++ b/t/t9301-fast-export.sh @@ -231,7 +231,7 @@ test_expect_success 'fast-export -C -C | fast-import' ' ' -test_expect_failure 'fast-export | fast-import when master is tagged' ' +test_expect_success 'fast-export | fast-import when master is tagged' ' git tag -m msg last && git fast-export -C -C --signed-tags=strip --all > output &&