Skip to content

Commit

Permalink
fast-export: use an unsorted string list for extra_refs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Nov 24, 2008
1 parent 283b953 commit 2075ffb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions builtin-fast-export.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion t/t9301-fast-export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit 2075ffb

Please sign in to comment.