Commit Graph

12 Commits

Author SHA1 Message Date
Scott J. Goldman
1a0c5a34e0 Fixup ahead/behind tests
Fix a typo that caused a failing test, and use cl_assert_equal
instead of cl_assert.
2012-11-29 18:11:30 -08:00
Russell Belfer
d5e44d8498 Fix function name and add real error check
`revwalk.h:commit_lookup()` -> `git_revwalk__commit_lookup()`
and make `git_commit_list_parse()` do real error checking that
the item in the list is an actual commit object.  Also fixed an
apparent typo in a test name.
2012-11-29 17:02:27 -08:00
Scott J. Goldman
0984c8768d Rename git_count_ahead_behind -> git_graph_ahead_behind
Moved it into graph.{c,h} which i created for the new "graph"
functions namespace. Also adjusted the function prototype
to use `size_t` and `const git_oid *`.
2012-11-28 18:54:57 -08:00
Scott J. Goldman
0d9e0323a5 Add the ahead/behind test that Carlos suggested
Adds a repo with a more complex topology to test the ahead-behind
count.
2012-11-28 18:54:57 -08:00
Scott J. Goldman
eddde61846 Add tests for ahead-behind count 2012-11-28 18:54:57 -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
Michael Schubert
8060cdc93c revwalk: fix off-by-one error
Fixes #921.
2012-09-27 19:12:01 +02:00
Vicent Marti
8c4c357f18 clar: Fix warnings 2012-06-19 02:43:36 +02:00
nulltoken
b46bdb2204 merge: Expose git_merge_base_many() 2012-06-07 16:25:37 +02:00
nulltoken
6183f0e2b2 merge: cleanup tests 2012-06-07 14:55:24 +02:00
nulltoken
7327a090e2 mergebase: enhance test code coverage 2012-05-13 14:14:08 +02:00
Carlos Martín Nieto
de7ab85dc6 Implement git_merge_base()
It's implemented in revwalk.c so it has access to the revision
walker's commit cache and related functions. The algorithm is the one
used by git, modified so it fits better with the library's functions.
2012-04-12 20:25:24 +02:00