Commits

Anonymous 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>

Comments (0)

Files changed (2)

builtin-fast-export.c

 		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;
 		else
 			commit->util = full_name;
 	}

t/t9301-fast-export.sh

 
 '
 
-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 &&
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.