Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
4623c25f
Commit
4623c25f
authored
Sep 23, 2017
by
Richard Ipsum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
notes: Add test that read of noteless commit fails
parent
d788f42a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
tests/notes/notes.c
+25
-0
No files found.
tests/notes/notes.c
View file @
4623c25f
...
@@ -415,6 +415,31 @@ void test_notes_notes__can_read_a_note_from_a_commit(void)
...
@@ -415,6 +415,31 @@ void test_notes_notes__can_read_a_note_from_a_commit(void)
git_note_free
(
note
);
git_note_free
(
note
);
}
}
/* Test that we can read a commit with no note fails */
void
test_notes_notes__attempt_to_read_a_note_from_a_commit_with_no_note_fails
(
void
)
{
git_oid
oid
,
notes_commit_oid
;
git_commit
*
notes_commit
;
git_note
*
note
;
cl_git_pass
(
git_oid_fromstr
(
&
oid
,
"4a202b346bb0fb0db7eff3cffeb3c70babbd2045"
));
cl_git_pass
(
git_note_commit_create
(
&
notes_commit_oid
,
NULL
,
_repo
,
NULL
,
_sig
,
_sig
,
&
oid
,
"I decorate 4a20
\n
"
,
1
));
git_commit_lookup
(
&
notes_commit
,
_repo
,
&
notes_commit_oid
);
cl_git_pass
(
git_note_commit_remove
(
&
notes_commit_oid
,
_repo
,
notes_commit
,
_sig
,
_sig
,
&
oid
));
git_commit_free
(
notes_commit
);
git_commit_lookup
(
&
notes_commit
,
_repo
,
&
notes_commit_oid
);
cl_assert
(
notes_commit
);
cl_git_fail_with
(
GIT_ENOTFOUND
,
git_note_commit_read
(
&
note
,
_repo
,
notes_commit
,
&
oid
));
git_commit_free
(
notes_commit
);
}
/*
/*
* $ git ls-tree refs/notes/fanout
* $ git ls-tree refs/notes/fanout
* 040000 tree 4b22b35d44b5a4f589edf3dc89196399771796ea 84
* 040000 tree 4b22b35d44b5a4f589edf3dc89196399771796ea 84
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment