aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-04-19 12:40:17 -0700
committerJunio C Hamano <gitster@pobox.com>2009-04-19 12:40:17 -0700
commit4f26c39806ee69bd68d6ea04b147eb2d877d0172 (patch)
tree205996e02a0d60a2670ceba8d0946afbffa0bb15
parentfe4ce3a72140d32d82aec860c8eb319a78205de6 (diff)
parentaadd44404baab7b1f7234c8815bfd1e6c980cd99 (diff)
downloadgit-4f26c39806ee69bd68d6ea04b147eb2d877d0172.tar.gz
git-4f26c39806ee69bd68d6ea04b147eb2d877d0172.tar.xz
Merge branch 'ef/maint-fast-export' into maint
* ef/maint-fast-export: builtin-fast-export.c: handle nested tags builtin-fast-export.c: fix crash on tagged trees builtin-fast-export.c: turn error into warning test-suite: adding a test for fast-export with tag variants
-rw-r--r--builtin-fast-export.c13
-rwxr-xr-xt/t9301-fast-export.sh15
2 files changed, 26 insertions, 2 deletions
diff --git a/builtin-fast-export.c b/builtin-fast-export.c
index fdf4ae9eb..f171ee4a2 100644
--- a/builtin-fast-export.c
+++ b/builtin-fast-export.c
@@ -362,7 +362,10 @@ static void get_tags_and_duplicates(struct object_array *pending,
break;
case OBJ_TAG:
tag = (struct tag *)e->item;
+
+ /* handle nested tags */
while (tag && tag->object.type == OBJ_TAG) {
+ parse_object(tag->object.sha1);
string_list_append(full_name, extra_refs)->util = tag;
tag = (struct tag *)tag->tagged;
}
@@ -375,11 +378,17 @@ static void get_tags_and_duplicates(struct object_array *pending,
case OBJ_BLOB:
handle_object(tag->object.sha1);
continue;
+ default: /* OBJ_TAG (nested tags) is already handled */
+ warning("Tag points to object of unexpected type %s, skipping.",
+ typename(tag->object.type));
+ continue;
}
break;
default:
- die ("Unexpected object of type %s",
- typename(e->item->type));
+ warning("%s: Unexpected object of type %s, skipping.",
+ e->name,
+ typename(e->item->type));
+ continue;
}
if (commit->util)
/* more than one name for the same object */
diff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh
index 86c376088..4a87f3625 100755
--- a/t/t9301-fast-export.sh
+++ b/t/t9301-fast-export.sh
@@ -259,4 +259,19 @@ test_expect_success 'cope with tagger-less tags' '
'
+test_expect_success 'set-up a few more tags for tag export tests' '
+ git checkout -f master &&
+ HEAD_TREE=`git show -s --pretty=raw HEAD | grep tree | sed "s/tree //"` &&
+ git tag tree_tag -m "tagging a tree" $HEAD_TREE &&
+ git tag -a tree_tag-obj -m "tagging a tree" $HEAD_TREE &&
+ git tag tag-obj_tag -m "tagging a tag" tree_tag-obj &&
+ git tag -a tag-obj_tag-obj -m "tagging a tag" tree_tag-obj
+'
+
+# NEEDSWORK: not just check return status, but validate the output
+test_expect_success 'tree_tag' 'git fast-export tree_tag'
+test_expect_success 'tree_tag-obj' 'git fast-export tree_tag-obj'
+test_expect_success 'tag-obj_tag' 'git fast-export tag-obj_tag'
+test_expect_success 'tag-obj_tag-obj' 'git fast-export tag-obj_tag-obj'
+
test_done