summaryrefslogtreecommitdiff
path: root/tests-clar/refs
Commit message (Collapse)AuthorAgeFilesLines
* Rename tests-clar to testsBen Straub2013-11-1434-4420/+0
|
* Change the git_branch_iterator_new and git_branch_next definitions to use ↵Arthur Schreiber2013-11-051-2/+2
| | | | git_branch_t.
* branch: move from foreach to an iteratorCarlos Martín Nieto2013-11-051-62/+40
| | | | | | | | Create a git_branch_iterator type which is equivalent to the foreach but lets us write loops instead of callbacks. Since the introduction of git_reference_shorthand(), the added value of passing the name is reduced.
* Merge pull request #1802 from libgit2/cmn/reflog-backendBen Straub2013-10-282-51/+65
|\ | | | | Make reflog part of refdb
| * reflog: add a convenience append functionCarlos Martín Nieto2013-10-021-25/+57
| | | | | | | | | | Provide a function that reads a reflog, performs an append and writes back to the backend in one call.
| * reflog: move the reflog implementation into refdb_fsCarlos Martín Nieto2013-10-022-27/+9
| | | | | | | | | | | | | | | | | | | | References and their logs are logically coupled, let's make it so in the code by moving the fs-based reflog implementation to live next to the fs-based refs one. As part of the change, make the function take names rather than references, as only the names are relevant when looking up and handling reflogs.
* | Merge pull request #1562 from libgit2/cmn/refs-namespace-lookupVicent Martí2013-10-111-0/+12
|\ \ | | | | | | Provide the user with a more useful error code when a looking up a reference which name points to a namepace
| * | futils: return GIT_ENOTFOUND when trying to read a directoryCarlos Martín Nieto2013-10-111-0/+12
| | | | | | | | | | | | | | | This lets the reference code return not-found when the user asks to look up a reference when in fact they pass a namespace.
* | | Make reference lookups apply precomposeunicodeRussell Belfer2013-10-081-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before these changes, looking up a reference would return the same precomposed or decomposed form of the reference name that was used to look it up, so on MacOS which ignores the difference between the two, a single reference could be looked up either way and git_reference_name would return the form of the name that was used to look it up! This change makes lookup always return the precomposed name if core.precomposeunicode is set regardless of which version was used to look it up. The reference iterator was already returning the precomposed form from earlier work. This also updates the CMakeLists.txt rules for enabling iconv usage because the clar tests for this code were actually not being activated properly with the old version. Finally, this moves git_repository_reset_filesystem from include/ git2/repository.h to include/git2/sys/repository.h since it is not really a function that normal library users should have to think about very often.
* | | More filemode cleanups for FAT on MacOSRussell Belfer2013-10-081-4/+19
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This cleans up some additional issues. The main change is that on a filesystem that doesn't support mode bits, libgit2 will now create new blobs with GIT_FILEMODE_BLOB always instead of being at the mercy to the filesystem driver to report executable or not. This means that if "core.filemode" lies and claims that filemode is not supported, then we will ignore the executable bit from the filesystem. Previously we would have allowed it. This adds an option to the new git_repository_reset_filesystem to recurse through submodules if desired. There may be other types of APIs that would like a "recurse submodules" option, but this one is particularly useful. This also has a number of cleanups, etc., for related things including trying to give better error messages when problems come up from the filesystem. For example, the FAT filesystem driver on MacOS appears to return errno EINVAL if you attempt to write a filename with invalid UTF-8 in it. We try to capture that with a better error message now.
* | No such thing as an orphan branchCarlos Martín Nieto2013-09-172-4/+4
| | | | | | | | | | | | | | | | | | | | | | Unfortunately git-core uses the term "unborn branch" and "orphan branch" interchangeably. However, "orphan" is only really there for the checkout command, which has the `--orphan` option so it doesn't actually create the branch. Branches never have parents, so the distinction of a branch with no parents is odd to begin with. Crucially, the error messages deal with unborn branches, so let's use that.
* | odb: Teach loose backend to return EAMBIGUOUSnulltoken2013-09-101-0/+31
| |
* | Merge pull request #1805 from libgit2/threading-packed-loadVicent Martí2013-08-281-2/+28
|\ \ | | | | | | Thread safety for the refdb_fs
| * | Fix commentRussell Belfer2013-08-231-1/+1
| | |
| * | Don't try to pack symbolic refsRussell Belfer2013-08-201-2/+28
| |/ | | | | | | | | | | If there were symbolic refs among the loose refs then the code to create packed-refs would fail trying to parse the OID out of them (where Git just skips trying to pack them). This fixes it.
* | refs: add git_reference_is_tagNikolai Vladimirov2013-08-261-0/+16
|/
* Add long-file-name branch to test repoBen Straub2013-08-071-2/+2
|
* revparse: Don't return a reference when asked for a git objectnulltoken2013-07-131-0/+41
| | | | Fix #1722
* ref: free the last ref when cancelling git_branch_foreach()yorah2013-06-171-1/+1
| | | | Also fixed an assert typo on nulltoken's HEAD
* Fix Windows warningsRussell Belfer2013-06-121-1/+1
| | | | | This fixes problems with missing function prototypes and 64-bit data issues on Windows.
* Reorganize diff and add basic diff driverRussell Belfer2013-06-104-13/+17
| | | | | | | | | | | | | | | | | | This is a significant reorganization of the diff code to break it into a set of more clearly distinct files and to document the new organization. Hopefully this will make the diff code easier to understand and to extend. This adds a new `git_diff_driver` object that looks of diff driver information from the attributes and the config so that things like function content in diff headers can be provided. The full driver spec is not implemented in the commit - this is focused on the reorganization of the code and putting the driver hooks in place. This also removes a few #includes from src/repository.h that were overbroad, but as a result required extra #includes in a variety of places since including src/repository.h no longer results in pulling in the whole world.
* Merge pull request #1624 from libgit2/vmg/full-ref-iteratorVicent Martí2013-06-031-16/+19
|\ | | | | Breaking RefDB changes
| * Liike thisVicent Marti2013-05-281-16/+19
| |
* | Merge pull request #1559 from carlosmn/ref-shorthandVicent Martí2013-05-311-0/+27
|\ \ | |/ |/| Introduce git_reference_shorthand
| * Introduce git_reference_shorthandCarlos Martín Nieto2013-05-081-0/+27
| | | | | | | | Generate a shorthand name out of the full refname.
* | revparse: Make revparse_ext() return git_reference from names as wellnulltoken2013-05-161-2/+2
| |
* | revparse: Introduce git_revparse_ext()nulltoken2013-05-161-2/+47
| | | | | | | | | | | | Expose a way to retrieve, along with the target git_object, the reference pointed at by some revparse expression (`@{<-n>}` or `<branchname>@{upstream}` syntax).
* | Fix trailing whitespacesnulltoken2013-05-154-33/+32
| |
* | Fix refdb iteration early termination bugRussell Belfer2013-05-111-8/+26
| | | | | | | | | | | | | | There was a problem found in the Rugged test suite where the refdb_fs_backend__next function could exit too early in some very specific hashing patterns for packed refs. This ports the Rugged test to libgit2 and then fixes the bug.
* | Merge pull request #1385 from carlosmn/refs-iterEdward Thomson2013-05-114-22/+105
|\ \ | | | | | | Introduce a refs iterator
| * | refs: remove the OID/SYMBOLIC filteringCarlos Martín Nieto2013-05-113-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Nobody should ever be using anything other than ALL at this level, so remove the option altogether. As part of this, git_reference_foreach_glob is now implemented in the frontend using an iterator. Backends will later regain the ability of doing the glob filtering in the backend.
| * | Remove outdated testCarlos Martín Nieto2013-05-111-11/+0
| | | | | | | | | | | | | | | Selecting wether to list loose or packed references is not something we want to support anymore, so remove a test for this.
| * | Make sure the ref iterator works in an repo without physical presenceCarlos Martín Nieto2013-05-111-0/+18
| | |
| * | refs: introduce an iteratorCarlos Martín Nieto2013-05-111-0/+76
| | | | | | | | | | | | This allows us to get a list of reference names in a loop instead of callbacks.
* | | Fix some memory leaksnulltoken2013-05-101-1/+2
| |/ |/|
* | git_branch_set_upstream with local branchesNikolai Vladimirov2013-05-061-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently git_branch_set_upstream when passed a local branch creates invalid configuration, for ex. if we setup branch 'tracking_master' to track local 'master' libgit2 generates the following config ``` [branch "track_master"] remote = . merge = .refs/heads/track_master ``` The merge value is invalid and calling git_branch_upstream on 'tracking_master' results in invalid reference error. It should do: ``` [branch "track_master"] remote = . merge = refs/heads/master ```
* | Merge pull request #1526 from arrbee/cleanup-error-return-without-msgVicent Martí2013-05-061-0/+6
|\ \ | |/ |/| Make sure error messages are set for most error returns
| * Set error message for branch functionsRussell Belfer2013-05-011-0/+6
| | | | | | | | | | There were a couple of places where an error was being returned from branch related code but no error message was being set.
* | refdb_fs: do not require peeled packed refs to be tagsJeff King2013-05-021-2/+29
|/ | | | | | Older versions of git would only write peeled entries for items under refs/tags/. Newer versions will write them for all refs, and we should be prepared to handle that.
* remote: allow querying for refspecsCarlos Martín Nieto2013-04-201-1/+1
| | | | | | | | Introduce git_remote_{fetch,push}_refspecs() to get a list of refspecs from the remote and rename the refspec-adding functions to a less silly name. Use this instead of the vector index hacks in the tests.
* remote: handle multiple refspecsCarlos Martín Nieto2013-04-201-1/+2
| | | | | | | | | | | | | A remote can have a multitude of refspecs. Up to now our git_remote's have supported a single one for each fetch and push out of simplicity to get something working. Let the remotes and internal code know about multiple remotes and get the tests passing with them. Instead of setting a refspec, the external users can clear all and add refspecs. This should be enough for most uses, though we're still missing a querying function.
* alloc doesn't take a refdb; git_refdb_free nicely in the testsEdward Thomson2013-04-193-0/+3
|
* git_revision -> git_revspecVicent Marti2013-04-151-14/+14
|
* Is this crazy?Vicent Marti2013-04-151-33/+26
|
* Merge remote-tracking branch 'ben/unified-revparse' into developmentVicent Marti2013-04-151-36/+99
|\
| * Change git_revparse to output git_object pointersBen Straub2013-04-151-7/+12
| | | | | | | | This will probably prevent many lookup/free operations in calling code.
| * Redeploy git_revparse_single.Ben Straub2013-04-151-61/+50
| |
| * Deprecate git_revparse_single and _rangelikeBen Straub2013-04-091-30/+40
| |
| * Implement unified git_revparseBen Straub2013-04-081-0/+59
| |
* | Merge pull request #1450 from carlosmn/branch-upstreamVicent Martí2013-04-115-138/+173
|\ \ | |/ |/| Branch upstream configuration