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 <johannes.schindelin@gmx.de> Tested-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Nov 23, 2008 at 12:55 UTC
2075ffb58e3a2d46d9e7606010f7f943f2295376
2 files changed
+3
-3
builtin-fast-export.c
+2
-2
@@ -354,7 +354,7 @@ static void get_tags_and_duplicates(struct object_array *pending,
354
case OBJ_TAG:
355
tag = (struct tag *)e->item;
356
while (tag && tag->object.type == OBJ_TAG) {
357
- string_list_insert(full_name, extra_refs)->util = tag;
357
+ string_list_append(full_name, extra_refs)->util = tag;
358
tag = (struct tag *)tag->tagged;
359
}
360
if (!tag)
@@ -374,7 +374,7 @@ static void get_tags_and_duplicates(struct object_array *pending,
374
}
375
if (commit->util)
376
/* more than one name for the same object */
377
- string_list_insert(full_name, extra_refs)->util = commit;
377
+ string_list_append(full_name, extra_refs)->util = commit;
378
else
379
commit->util = full_name;
380
}
t/t9301-fast-export.sh
+1
-1
@@ -231,7 +231,7 @@ test_expect_success 'fast-export -C -C | fast-import' '
231
232
'
233
234
-test_expect_failure 'fast-export | fast-import when master is tagged' '
234
+test_expect_success 'fast-export | fast-import when master is tagged' '
235
236
git tag -m msg last &&
237
git fast-export -C -C --signed-tags=strip --all > output &&