summaryrefslogtreecommitdiff
path: root/tests-clar/refs/revparse.c
diff options
context:
space:
mode:
authorBen Straub <bstraub@github.com>2012-04-25 19:08:17 -0700
committerBen Straub <bstraub@github.com>2012-05-11 11:30:45 -0700
commit023c6f69edcacfefe36a2b7d606def32d5bc246c (patch)
tree517dd939ebcf3f8c283bf7e4783e7e001d208ceb /tests-clar/refs/revparse.c
parentac250c56c7d7bb11691c9dfbcd0dbf580d85e177 (diff)
downloadlibgit2-023c6f69edcacfefe36a2b7d606def32d5bc246c.tar.gz
Simpler states and initial structure.
New tests for "foo^2" syntax, but they don't pass yet. Support for chaining these, i.e. "foo^2~3^{u}~1' is starting to shape up.
Diffstat (limited to 'tests-clar/refs/revparse.c')
-rw-r--r--tests-clar/refs/revparse.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests-clar/refs/revparse.c b/tests-clar/refs/revparse.c
index 05c12b074..90aaf5423 100644
--- a/tests-clar/refs/revparse.c
+++ b/tests-clar/refs/revparse.c
@@ -72,3 +72,19 @@ void test_refs_revparse__describe_output(void)
oid_str_cmp(git_object_id(g_obj), "c47800c7266a2be04c571c04d5a6614691ea99bd");
}
+void test_refs_revparse__nth_parent(void)
+{
+ cl_git_pass(git_revparse_single(&g_obj, g_repo, "be3563a^1"));
+ oid_str_cmp(git_object_id(g_obj), "9fd738e8f7967c078dceed8190330fc8648ee56a");
+ cl_git_pass(git_revparse_single(&g_obj, g_repo, "be3563a^2"));
+ oid_str_cmp(git_object_id(g_obj), "c47800c7266a2be04c571c04d5a6614691ea99bd");
+ cl_git_pass(git_revparse_single(&g_obj, g_repo, "be3563a^1^1"));
+ oid_str_cmp(git_object_id(g_obj), "4a202b346bb0fb0db7eff3cffeb3c70babbd2045");
+ cl_git_pass(git_revparse_single(&g_obj, g_repo, "be3563a^2^1"));
+ oid_str_cmp(git_object_id(g_obj), "5b5b025afb0b4c913b4c338a42934a3863bf3644");
+}
+
+void test_refs_revparse__reflog(void)
+{
+ // TODO: how to create a fixture for this? git_reflog_write?
+}