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
d0a3de72
Commit
d0a3de72
authored
Jan 24, 2014
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
note: rename the id getter to git_note_id()
This was left over when we did the general switch.
parent
ca55fc63
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
11 deletions
+11
-11
include/git2/notes.h
+3
-3
src/notes.c
+3
-3
src/notes.h
+1
-1
tests/notes/notes.c
+2
-2
tests/notes/notesref.c
+2
-2
No files found.
include/git2/notes.h
View file @
d0a3de72
...
@@ -106,12 +106,12 @@ GIT_EXTERN(const char *) git_note_message(const git_note *note);
...
@@ -106,12 +106,12 @@ GIT_EXTERN(const char *) git_note_message(const git_note *note);
/**
/**
* Get the note object
OID
* Get the note object
's id
*
*
* @param note the note
* @param note the note
* @return the note object
OID
* @return the note object
's id
*/
*/
GIT_EXTERN
(
const
git_oid
*
)
git_note_
o
id
(
const
git_note
*
note
);
GIT_EXTERN
(
const
git_oid
*
)
git_note_id
(
const
git_note
*
note
);
/**
/**
* Add a note for an object
* Add a note for an object
...
...
src/notes.c
View file @
d0a3de72
...
@@ -313,7 +313,7 @@ static int note_new(git_note **out, git_oid *note_oid, git_blob *blob)
...
@@ -313,7 +313,7 @@ static int note_new(git_note **out, git_oid *note_oid, git_blob *blob)
note
=
(
git_note
*
)
git__malloc
(
sizeof
(
git_note
));
note
=
(
git_note
*
)
git__malloc
(
sizeof
(
git_note
));
GITERR_CHECK_ALLOC
(
note
);
GITERR_CHECK_ALLOC
(
note
);
git_oid_cpy
(
&
note
->
o
id
,
note_oid
);
git_oid_cpy
(
&
note
->
id
,
note_oid
);
note
->
message
=
git__strdup
((
char
*
)
git_blob_rawcontent
(
blob
));
note
->
message
=
git__strdup
((
char
*
)
git_blob_rawcontent
(
blob
));
GITERR_CHECK_ALLOC
(
note
->
message
);
GITERR_CHECK_ALLOC
(
note
->
message
);
...
@@ -508,10 +508,10 @@ const char * git_note_message(const git_note *note)
...
@@ -508,10 +508,10 @@ const char * git_note_message(const git_note *note)
return
note
->
message
;
return
note
->
message
;
}
}
const
git_oid
*
git_note_
o
id
(
const
git_note
*
note
)
const
git_oid
*
git_note_id
(
const
git_note
*
note
)
{
{
assert
(
note
);
assert
(
note
);
return
&
note
->
o
id
;
return
&
note
->
id
;
}
}
void
git_note_free
(
git_note
*
note
)
void
git_note_free
(
git_note
*
note
)
...
...
src/notes.h
View file @
d0a3de72
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
"Notes removed by 'git_note_remove' from libgit2"
"Notes removed by 'git_note_remove' from libgit2"
struct
git_note
{
struct
git_note
{
git_oid
o
id
;
git_oid
id
;
char
*
message
;
char
*
message
;
};
};
...
...
tests/notes/notes.c
View file @
d0a3de72
...
@@ -21,7 +21,7 @@ static void assert_note_equal(git_note *note, char *message, git_oid *note_oid)
...
@@ -21,7 +21,7 @@ static void assert_note_equal(git_note *note, char *message, git_oid *note_oid)
git_blob
*
blob
;
git_blob
*
blob
;
cl_assert_equal_s
(
git_note_message
(
note
),
message
);
cl_assert_equal_s
(
git_note_message
(
note
),
message
);
cl_assert
(
!
git_oid_cmp
(
git_note_
o
id
(
note
),
note_oid
));
cl_assert
(
!
git_oid_cmp
(
git_note_id
(
note
),
note_oid
));
cl_git_pass
(
git_blob_lookup
(
&
blob
,
_repo
,
note_oid
));
cl_git_pass
(
git_blob_lookup
(
&
blob
,
_repo
,
note_oid
));
cl_assert_equal_s
(
git_note_message
(
note
),
(
const
char
*
)
git_blob_rawcontent
(
blob
));
cl_assert_equal_s
(
git_note_message
(
note
),
(
const
char
*
)
git_blob_rawcontent
(
blob
));
...
@@ -290,7 +290,7 @@ void test_notes_notes__can_read_a_note_in_an_existing_fanout(void)
...
@@ -290,7 +290,7 @@ void test_notes_notes__can_read_a_note_in_an_existing_fanout(void)
cl_git_pass
(
git_note_read
(
&
note
,
_repo
,
"refs/notes/fanout"
,
&
target_oid
));
cl_git_pass
(
git_note_read
(
&
note
,
_repo
,
"refs/notes/fanout"
,
&
target_oid
));
cl_git_pass
(
git_oid_fromstr
(
&
note_oid
,
"08b041783f40edfe12bb406c9c9a8a040177c125"
));
cl_git_pass
(
git_oid_fromstr
(
&
note_oid
,
"08b041783f40edfe12bb406c9c9a8a040177c125"
));
cl_assert
(
!
git_oid_cmp
(
git_note_
o
id
(
note
),
&
note_oid
));
cl_assert
(
!
git_oid_cmp
(
git_note_id
(
note
),
&
note_oid
));
git_note_free
(
note
);
git_note_free
(
note
);
}
}
...
...
tests/notes/notesref.c
View file @
d0a3de72
...
@@ -46,13 +46,13 @@ void test_notes_notesref__config_corenotesref(void)
...
@@ -46,13 +46,13 @@ void test_notes_notesref__config_corenotesref(void)
cl_git_pass
(
git_note_read
(
&
_note
,
_repo
,
NULL
,
&
oid
));
cl_git_pass
(
git_note_read
(
&
_note
,
_repo
,
NULL
,
&
oid
));
cl_assert_equal_s
(
"test123test
\n
"
,
git_note_message
(
_note
));
cl_assert_equal_s
(
"test123test
\n
"
,
git_note_message
(
_note
));
cl_assert
(
!
git_oid_cmp
(
git_note_
o
id
(
_note
),
&
note_oid
));
cl_assert
(
!
git_oid_cmp
(
git_note_id
(
_note
),
&
note_oid
));
git_note_free
(
_note
);
git_note_free
(
_note
);
cl_git_pass
(
git_note_read
(
&
_note
,
_repo
,
"refs/notes/mydefaultnotesref"
,
&
oid
));
cl_git_pass
(
git_note_read
(
&
_note
,
_repo
,
"refs/notes/mydefaultnotesref"
,
&
oid
));
cl_assert_equal_s
(
"test123test
\n
"
,
git_note_message
(
_note
));
cl_assert_equal_s
(
"test123test
\n
"
,
git_note_message
(
_note
));
cl_assert
(
!
git_oid_cmp
(
git_note_
o
id
(
_note
),
&
note_oid
));
cl_assert
(
!
git_oid_cmp
(
git_note_id
(
_note
),
&
note_oid
));
cl_git_pass
(
git_note_default_ref
(
&
default_ref
,
_repo
));
cl_git_pass
(
git_note_default_ref
(
&
default_ref
,
_repo
));
cl_assert_equal_s
(
"refs/notes/mydefaultnotesref"
,
default_ref
);
cl_assert_equal_s
(
"refs/notes/mydefaultnotesref"
,
default_ref
);
...
...
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