Commit Graph

15 Commits

Author SHA1 Message Date
Russell Belfer
4cee9b8618 Update init and clean for revwalk::basic tests
The new tests don't always want to use the same fixture data as
the old ones so this makes it configurable on a per-test basis.
2013-07-22 11:41:23 -07:00
Russell Belfer
b71071313f git_reference_next_name must match git_reference_next
The git_reference_next API silently skips invalid references when
scanning the loose refs.  The git_reference_next_name API should
skip the same ones even though it isn't creating the reference
object.

This adds a test with a an invalid loose reference and makes sure
that both APIs skip the same entries and generate the same results.
2013-07-22 11:01:19 -07:00
Greg Price
af079d8bf6 revwalk: Parse revision ranges
All the hard work is already in revparse.

Signed-off-by: Greg Price <price@mit.edu>
2013-04-06 20:51:16 -07:00
Greg Price
2932c8826a revwalk: refactor tests a bit
Signed-off-by: Greg Price <price@mit.edu>
2013-03-31 15:33:22 -07:00
Greg Price
06e6eab0e2 revwalk tests: better diagram of example repo
The purported command output was already inaccurate, as the refs
aren't where it shows.  In any event, the labels a reader of this
file really needs are the indices used in commit_sorting_*, to make
it possible to understand them by referring directly from those
arrays to the diagram rather than from the index arrays, to commit_ids,
to the diagram.  Add those.

Signed-off-by: Greg Price <price@mit.edu>
2013-03-31 15:33:22 -07: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
4e323ef0a8 revwalk: refuse push of non-commit objects
Check the type of the pushed object immediately instead of starting the
walk and failing in between.
2012-08-27 11:52:32 +02:00
nulltoken
5b07111529 tests: add test commit with angle brackets in the author name 2012-07-11 20:40:12 +02:00
Vicent Martí
e172cf082e errors: Rename the generic return codes 2012-05-18 01:26:26 +02:00
Carlos Martín Nieto
5cf7bccd2b revwalk: add test hiding a commit without a merge base
Nothing should be hidden and this shouldn't bother the merge base
calculation.
2012-04-12 20:25:25 +02:00
Carlos Martín Nieto
06b9d91590 revwalk: allow pushing/hiding a reference by name
The code was already there, so factor it out and let users push an OID
by giving it a reference name. Only refs to commits are
supported. Annotated tags will throw an error.
2012-04-12 20:25:24 +02:00
Carlos Martín Nieto
a4a910dd9c Simple test for pushing HEAD and hiding a branch 2012-02-27 22:46:45 +01:00
Carlos Martín Nieto
f7367993cb revwalk: add convenience function to push/hide HEAD
It's not unusual to want the walker to act on HEAD, so add a
convencience function for the case that the user doesn't already have
a resolved HEAD reference.
2012-02-27 22:26:37 +01:00
Carlos Martín Nieto
f0fa1c1a73 Add revwalk glob test 2012-02-27 22:07:20 +01:00
Carlos Martín Nieto
8f7be6ca8a Move revwalk test to clar 2012-02-27 21:38:22 +01:00