summaryrefslogtreecommitdiff
path: root/tests/refs/revparse.c
Commit message (Collapse)AuthorAgeFilesLines
* refactor: `tests` is now `tests/libgit2`Edward Thomson2022-02-221-890/+0
| | | | | | Like we want to separate libgit2 and utility source code, we want to separate libgit2 and utility tests. Start by moving all the tests into libgit2.
* revparse: support bare '@'Edward Thomson2022-01-301-0/+7
| | | | A bare '@' revision syntax represents HEAD. Support it as such.
* Merge branch 'main' into better-compatiblity-for-at-time-notationYoichi Nakayama2021-11-231-2/+2
|\ | | | | | | | | Conflicts: src/revparse.c
| * path: separate git-specific path functions from utilEdward Thomson2021-11-091-2/+2
| | | | | | | | | | | | Introduce `git_fs_path`, which operates on generic filesystem paths. `git_path` will be kept for only git-specific path functionality (for example, checking for `.git` in a path).
* | Cause error when date parsing is failedYoichi Nakayama2021-10-221-0/+13
| |
* | Return the oldest reflog entry on revparse when older time is givenYoichi Nakayama2021-10-221-5/+12
|/ | | | | For better compatibility with git command which returns the oldest log entry with a warning message.
* str: introduce `git_str` for internal, `git_buf` is externalethomson/gitstrEdward Thomson2021-10-171-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | libgit2 has two distinct requirements that were previously solved by `git_buf`. We require: 1. A general purpose string class that provides a number of utility APIs for manipulating data (eg, concatenating, truncating, etc). 2. A structure that we can use to return strings to callers that they can take ownership of. By using a single class (`git_buf`) for both of these purposes, we have confused the API to the point that refactorings are difficult and reasoning about correctness is also difficult. Move the utility class `git_buf` to be called `git_str`: this represents its general purpose, as an internal string buffer class. The name also is an homage to Junio Hamano ("gitstr"). The public API remains `git_buf`, and has a much smaller footprint. It is generally only used as an "out" param with strict requirements that follow the documentation. (Exceptions exist for some legacy APIs to avoid breaking callers unnecessarily.) Utility functions exist to convert a user-specified `git_buf` to a `git_str` so that we can call internal functions, then converting it back again.
* revspec: rename git_revparse_mode_t to git_revspec_tethomson/revparseEdward Thomson2021-01-311-13/+13
| | | | | | The information about the type of a revision spec is not information about the parser. Name it accordingly, so that `git_revparse_mode_t` is now `git_revspec_t`. Deprecate the old name.
* Convert usage of `git_buf_free` to new `git_buf_dispose`Patrick Steinhardt2018-06-101-1/+1
|
* revparse: support open-ended rangesWilliam Bain2017-05-051-0/+35
| | | | | | | Support '..' and '...' ranges where one side is not specified. The unspecified side defaults to HEAD. Closes #4223
* revparse: Add test to make sure this doesn't regressVicent Marti2015-06-261-0/+15
|
* branch: don't accept a reflog message overrideCarlos Martín Nieto2015-03-031-3/+3
| | | | | | | This namespace is about behaving like git's branch command, so let's do exactly that instead of taking a reflog message. This override is still available via the reference namespace.
* Remove the signature from ref-modifying functionsCarlos Martín Nieto2015-03-031-5/+5
| | | | | | | | | | The signature for the reflog is not something which changes dynamically. Almost all uses will be NULL, since we want for the repository's default identity to be used, making it noise. In order to allow for changing the identity, we instead provide git_repository_set_ident() and git_repository_ident() which allow a user to override the choice of signature.
* peel: reject bad queries with EINVALIDSPECcmn/peeling-errorsCarlos Martín Nieto2014-11-221-3/+3
| | | | | | | | | | There are some combination of objects and target types which we know cannot be fulfilled. Return EINVALIDSPEC for those to signify that there is a mismatch in the user-provided data and what the object model is capable of satisfying. If we start at a tag and in the course of peeling find out that we cannot reach a particular type, we return EPEEL.
* Ensure renaming a reference updates the reflogBen Straub2014-01-301-1/+1
|
* Add reflog params to git_branch_createBen Straub2014-01-301-3/+3
|
* refs: remove the _with_log differentiationCarlos Martín Nieto2014-01-151-1/+2
| | | | | | Any well-behaved program should write a descriptive message to the reflog whenever it updates a reference. Let's make this more prominent by removing the version without the reflog parameters.
* Rename tests-clar to testsBen Straub2013-11-141-0/+813