Commit Graph

23 Commits

Author SHA1 Message Date
Nico von Geyso
aa518c709c added missing free for git_note in clar tests 2013-03-06 22:51:20 +01:00
Nico von Geyso
f7b1850215 fixed minor issues with new note iterator
* fixed style issues
* use new iterator functions for git_note_foreach()
2013-03-06 22:36:19 +01:00
Nico von Geyso
1a90dcf64e use git_note_iterator type instead of non-public git_iterator one 2013-03-06 19:07:56 +01:00
Nico von Geyso
6edb427b76 basic note iterator implementation
* git_note_iterator_new() - create a new note iterator
* git_note_next() - retrieves the next item of the iterator
2013-03-06 17:01:33 +01:00
Sebastian Bauer
a7f8065f8c Use cl_assert_equal_s() instead of strcmp().
Replaced all cl_assert(!strcmp()) or semantically equivalent forms
by cl_assert_equal_s().
2013-01-25 06:55:56 +01:00
Nikolai Vladimirov
8716b499e2 add option to allow git note overwrite 2013-01-03 16:31:36 +02:00
Russell Belfer
2bd5998c9c Remove git_note_data structure 2012-11-27 14:47:39 -08:00
Ben Straub
54b2a37ac7 Clean up config.h 2012-11-27 13:18:28 -08:00
Sascha Cunz
9094d30b93 Reset all static variables to NULL in clar's __cleanup
Without this change, any failed assertion in the second (or a later) test
inside a test suite has a chance of double deleting memory, resulting in
a heap corruption. See #1096 for details.

This leaves alone the test cases where we "just" use cl_git_sandbox_init()
and cl_git_sandbox_cleanup(). These methods already take good care to not
double delete a repository.

Fixes #1096
2012-11-23 11:41:56 +01:00
Russell Belfer
5dca201072 Update iterators for consistency across library
This updates all the `foreach()` type functions across the library
that take callbacks from the user to have a consistent behavior.
The rules are:

* A callback terminates the loop by returning any non-zero value
* Once the callback returns non-zero, it will not be called again
  (i.e. the loop stops all iteration regardless of state)
* If the callback returns non-zero, the parent fn returns GIT_EUSER
* Although the parent returns GIT_EUSER, no error will be set in
  the library and `giterr_last()` will return NULL if called.

This commit makes those changes across the library and adds tests
for most of the iteration APIs to make sure that they follow the
above rules.
2012-08-03 17:08:01 -07:00
Michael Schubert
dca6b228d1 notes: fix memory leaks 2012-06-21 10:33:24 +02:00
yorah
027d77ee5c notes: simplify tests 2012-06-12 14:30:33 +02:00
yorah
a02e724978 notes: simplify the handling of fanouts
- Do not create new levels of fanout when creating notes from libgit2
 - Insert a note in an existing matching fanout
 - Remove a note from an existing fanout
 - Cleanup git_note_read, git_note_remove, git_note_foreach, git_note_create methods in order use tree structures instead of tree_oids
2012-06-08 20:34:24 +02:00
yorah
3a0d1e12db notes: add failing test 2012-06-08 00:17:09 +02:00
nulltoken
ee7680d53b notes: make git_note_foreach() callback signature easier to cope with from a binding perspective 2012-05-16 21:51:45 +02:00
nulltoken
d5ed6348c7 Fix compilation warnings 2012-05-14 22:24:58 +02:00
nulltoken
86ecd84427 notes: add git_notes_foreach() 2012-05-14 22:07:42 +02:00
Michael Schubert
630c5a4a54 notes: add git_note_default_ref()
Add git_note_default_ref to allow easy retrieval of the currently set
default notes reference.
2012-05-03 22:31:29 +02:00
Michael Schubert
caea5e5433 notes: honor core.notesRef
Setting core.notesRef allows to change the default notes reference used
by Git. Check if set before using GIT_NOTES_DEFAULT_REF. Fixes #649.
2012-05-03 22:31:29 +02:00
Vicent Martí
946a6dc4e6 Update test suite 2012-05-02 16:14:30 -07:00
Ben Straub
20ec426dde Discovered cl_git_strequal! Mounted a crusade! 2012-03-31 19:47:59 -07:00
schu
aa4254d92e tests-clar/notes: init oid before using
Reported-by: Carlos Martín Nieto <carlos@cmartin.tk>
Signed-off-by: schu <schu-github@schulog.org>
2012-02-23 23:38:48 +01:00
schu
bf477ed4a8 Add git notes API
This commit adds basic git notes support to libgit2, namely:

* git_note_read
* git_note_message
* git_note_oid
* git_note_create
* git_note_remove

In the long run, we probably want to provide some convenience callback
mechanism for merging and moving (filter-branch) notes.

Signed-off-by: schu <schu-github@schulog.org>
2012-02-15 20:32:14 +01:00