@@ -412,15 +412,16 @@ void object_array_clear(struct object_array *array)
}
/*
- * Return true iff array already contains an entry with name.
+ * Return true if array already contains an entry.
*/
-static int contains_name(struct object_array *array, const char *name)
+static int contains_object(struct object_array *array,
+ const struct object *item, const char *name)
{
unsigned nr = array->nr, i;
struct object_array_entry *object = array->objects;
for (i = 0; i < nr; i++, object++)
- if (!strcmp(object->name, name))
+ if (item == object->item && !strcmp(object->name, name))
return 1;
return 0;
}
@@ -432,7 +433,8 @@ void object_array_remove_duplicates(struct object_array *array)
array->nr = 0;
for (src = 0; src < nr; src++) {
- if (!contains_name(array, objects[src].name)) {
+ if (!contains_object(array, objects[src].item,
+ objects[src].name)) {
if (src != array->nr)
objects[array->nr] = objects[src];
array->nr++;
@@ -167,7 +167,7 @@ test_expect_success 'setup' '
test_commit_setvar P "Commit P" main.txt
'
-test_expect_failure 'create bundle from special rev: main^!' '
+test_expect_success 'create bundle from special rev: main^!' '
git bundle create special-rev.bdl "main^!" &&
git bundle list-heads special-rev.bdl |