Skip to content

Commit 2075ffb

Browse files
dschogitster
authored andcommitted
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 <[email protected]> Tested-by: Miklos Vajna <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 283b953 commit 2075ffb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

builtin-fast-export.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ static void get_tags_and_duplicates(struct object_array *pending,
354354
case OBJ_TAG:
355355
tag = (struct tag *)e->item;
356356
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;
358358
tag = (struct tag *)tag->tagged;
359359
}
360360
if (!tag)
@@ -374,7 +374,7 @@ static void get_tags_and_duplicates(struct object_array *pending,
374374
}
375375
if (commit->util)
376376
/* 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;
378378
else
379379
commit->util = full_name;
380380
}

t/t9301-fast-export.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ test_expect_success 'fast-export -C -C | fast-import' '
231231
232232
'
233233

234-
test_expect_failure 'fast-export | fast-import when master is tagged' '
234+
test_expect_success 'fast-export | fast-import when master is tagged' '
235235
236236
git tag -m msg last &&
237237
git fast-export -C -C --signed-tags=strip --all > output &&

0 commit comments

Comments
 (0)