1. Stefan Saasen
  2. git


Johannes Schindelin  committed 2075ffb

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>

  • Participants
  • Parent commits 283b953
  • Branches master

Comments (0)

Files changed (2)

File builtin-fast-export.c

View file
  • Ignore whitespace
 		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)
 		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;
 			commit->util = full_name;

File t/t9301-fast-export.sh

View file
  • Ignore whitespace
-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 &&