summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Pospisil <mekishizufu@gmail.com>2014-03-08 00:49:18 +0100
committerRussell Belfer <rb@github.com>2014-03-10 11:35:14 -0700
commiteb46fb2ba965f4e25946090dd172fcc3b20d93ee (patch)
tree5be5ba920e8f16bfa1bde2fc8f97640e0b221066
parent894990788771bef6ca20398e46b217817b8e0db8 (diff)
downloadlibgit2-eb46fb2ba965f4e25946090dd172fcc3b20d93ee.tar.gz
Add failing test for git_object_short_id
-rw-r--r--tests/object/shortid.c7
-rw-r--r--tests/resources/duplicate.git/objects/03/8d718da6a1ebbc6a7780a96ed75a70cc2ad6e2bin0 -> 23 bytes
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/object/shortid.c b/tests/object/shortid.c
index fa1dac09a..d854cb78e 100644
--- a/tests/object/shortid.c
+++ b/tests/object/shortid.c
@@ -26,6 +26,13 @@ void test_object_shortid__select(void)
cl_assert_equal_s("ce01362", shorty.ptr);
git_object_free(obj);
+ git_oid_fromstr(&full, "038d718da6a1ebbc6a7780a96ed75a70cc2ad6e2");
+ cl_git_pass(git_object_lookup(&obj, _repo, &full, GIT_OBJ_ANY));
+ cl_git_pass(git_object_short_id(&shorty, obj));
+ cl_assert_equal_i(7, shorty.size);
+ cl_assert_equal_s("038d718", shorty.ptr);
+ git_object_free(obj);
+
git_oid_fromstr(&full, "dea509d097ce692e167dfc6a48a7a280cc5e877e");
cl_git_pass(git_object_lookup(&obj, _repo, &full, GIT_OBJ_ANY));
cl_git_pass(git_object_short_id(&shorty, obj));
diff --git a/tests/resources/duplicate.git/objects/03/8d718da6a1ebbc6a7780a96ed75a70cc2ad6e2 b/tests/resources/duplicate.git/objects/03/8d718da6a1ebbc6a7780a96ed75a70cc2ad6e2
new file mode 100644
index 000000000..7350d98a2
--- /dev/null
+++ b/tests/resources/duplicate.git/objects/03/8d718da6a1ebbc6a7780a96ed75a70cc2ad6e2
Binary files differ