summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* config: perform unlocking via git_transactioncmn/config-txCarlos Martín Nieto2015-08-121-3/+4
| | | | | This makes the API for commiting or discarding changes the same as for references.
* config: expose locking via the main APICarlos Martín Nieto2015-08-121-19/+22
| | | | | | | | | This lock/unlock pair allows for the cller to lock a configuration file to avoid concurrent operations. It also allows for a transactional approach to updating a configuration file. If multiple updates must be made atomically, they can be done while the config is locked.
* config: implement basic transactional supportCarlos Martín Nieto2015-08-121-0/+46
| | | | | | | When a configuration file is locked, any updates made to it will be done to the in-memory copy of the file. This allows for multiple updates to happen while we hold the lock, preventing races during complex config-file manipulation.
* errors: tighten up git_error_state OOMs a bit moreEdward Thomson2015-08-031-5/+28
| | | | | When an error state is an OOM, make sure that we treat is specially and do not try to free it.
* Test: check restored oom error points to static bufferMichael Procter2015-08-031-4/+4
|
* Add failing test for capture/restore oom errorMichael Procter2015-08-031-0/+23
|
* Merge pull request #3325 from libgit2/cmn/filebuf-rename-errorEdward Thomson2015-08-031-0/+27
|\ | | | | filebuf: remove lockfile upon rename errors
| * filebuf: remove lockfile upon rename errorscmn/filebuf-rename-errorCarlos Martín Nieto2015-07-241-1/+1
| | | | | | | | | | | | | | | | | | | | When we have an error renaming the lockfile, we need to make sure that we remove it upon cleanup. For this, we need to keep track of whether we opened the file and whether the rename succeeded. If we did create the lockfile but the rename did not succeed, we remove the lockfile. This won't protect against all errors, but the most common ones (target file is open) does get handled.
| * filebuf: failing test for leaving the lockfile when failing to renameCarlos Martín Nieto2015-07-241-0/+27
| | | | | | | | | | When we fail to rename, we currently leave the lockfile laying around. This shows that behaviour.
* | index: test that an unregistered submodule gets stagedCarlos Martín Nieto2015-08-011-1/+7
| | | | | | | | | | | | When we pass the path of a repository to `_bypath()`, we should behave like git and stage it as a `_COMMIT` regardless of whether it is registered a a submodule.
* | index: add test for adding an old-style submodule to indexLinquize2015-08-011-0/+7
| |
* | Merge pull request #3328 from libgit2/cmn/iterator-skip-diriterEdward Thomson2015-07-291-5/+1
|\ \ | | | | | | iterator: skip over errors in diriter init
| * | iterator: adjust unreadable-dir test to new behaviourcmn/iterator-skip-diriterCarlos Martín Nieto2015-07-271-5/+1
| |/ | | | | | | | | We don't want the iterator to make us stop whenever we hit an unreadable dir. We should instead move over to the next item.
* | Merge pull request #3307 from libgit2/cmn/submodule-backslashEdward Thomson2015-07-241-0/+23
|\ \ | | | | | | Normalize submodule urls before looking at them
| * | submodule: add failing test for backslash in urlCarlos Martín Nieto2015-07-131-0/+23
| | |
* | | Merge pull request #3303 from libgit2/cmn/index-add-submoduleEdward Thomson2015-07-242-0/+36
|\ \ \ | | | | | | | | Allow adding a submodule through git_index_add_bypath
| * | | index: allow add_bypath to update submodulescmn/index-add-submoduleCarlos Martín Nieto2015-07-121-0/+12
| | | | | | | | | | | | | | | | | | | | Similarly to how git itself does it, allow the index update operation to stage a change in a submodule's HEAD.
| * | | blob: fail to create a blob from a dir with EDIRECTORYCarlos Martín Nieto2015-07-122-0/+24
| | | | | | | | | | | | | | | | | | | | This also affects `git_index_add_bypath()` by providing a better error message and a specific error code when a directory is passed.
* | | | Merge pull request #3305 from libgit2/cmn/reflog-del-backendEdward Thomson2015-07-241-0/+2
|\ \ \ \ | |_|_|/ |/| | | refdb: delete a ref's reflog upon deletion
| * | | refdb: delete a ref's reflog upon deletioncmn/reflog-del-backendCarlos Martín Nieto2015-07-121-0/+2
| |/ / | | | | | | | | | | | | | | | Removing a reflog upon ref deletion is something which only some backends might wish to do. Backends which are database-backed may wish to archive a reflog, log-based ones may not need to do anything.
* | | Merge pull request #3302 from libgit2/cmn/submodule-foreach-diff-pathCarlos Martín Nieto2015-07-131-0/+18
|\ \ \ | |_|/ |/| | List a submodule only once when the path matches a submodule in the index
| * | submdule: reproduce double-reporting of a submodule in foreachCarlos Martín Nieto2015-07-111-0/+18
| | | | | | | | | | | | | | | | | | When we rename a submodule, we should be merging two sets of information based on whether their path is the same. We currently only deduplicate on equal name, which causes us to double-report.
* | | Merge branch 'portable-zu'Carlos Martín Nieto2015-07-123-4/+4
|\ \ \ | |_|/ |/| |
| * | Fix #3094 - improve use of portable size_t/ssize_t format specifiers.Matthew Plough2015-07-123-4/+4
| | | | | | | | | | | | The header src/cc-compat.h defines portable format specifiers PRIuZ, PRIdZ, and PRIxZ. The original report highlighted the need to use these specifiers in examples/network/fetch.c. For this commit, I checked all C source and header files not in deps/ and transitioned to the appropriate format specifier where appropriate.
* | | wildcard filters: move CHANGELOG message to 0.23+1Edward Thomson2015-07-101-2/+1
| | |
* | | wildcard filters: clean up some warnings in testsEdward Thomson2015-07-101-5/+9
| | |
* | | Merge pull request #3281 from ethomson/wildcard_filtersCarlos Martín Nieto2015-07-094-104/+310
|\ \ \ | | | | | | | | filters: custom filters with wildcard attributes
| * | | filters: custom filters with wildcard attributesEdward Thomson2015-07-014-104/+310
| | | | | | | | | | | | | | | | | | | | | | | | Allow custom filters with wildcard attributes, so that clients can support some random `filter=foo` in a .gitattributes and look up the corresponding smudge/clean commands in the configuration file.
* | | | revert: correct test that added trailing newlineEdward Thomson2015-07-071-10/+12
| | | |
* | | | merge_files: don't add trailing newlinesEdward Thomson2015-07-071-0/+39
| | | | | | | | | | | | | | | | | | | | When invoked with three files that each lack a trailing newline, the merge result should also lack a trailing newline.
* | | | Merge pull request #3277 from git-up/git_diff_index_to_indexCarlos Martín Nieto2015-07-071-0/+32
|\ \ \ \ | | | | | | | | | | Added git_diff_index_to_index()
| * | | | Added git_diff_index_to_index()Pierre-Olivier Latour2015-06-301-0/+32
| | | | |
* | | | | Merge pull request #3288 from ethomson/getenvCarlos Martín Nieto2015-07-078-92/+104
|\ \ \ \ \ | | | | | | | | | | | | git__getenv: utf-8 aware env reader
| * | | | | git__getenv: utf-8 aware env readerEdward Thomson2015-07-028-92/+104
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | Introduce `git__getenv` which is a UTF-8 aware `getenv` everywhere. Make `cl_getenv` use this to keep consistent memory handling around return values (free everywhere, as opposed to only some platforms).
* | | | | Merge pull request #3202 from jeffhostetler/windows_stack_traceCarlos Martín Nieto2015-07-063-19/+170
|\ \ \ \ \ | |_|_|_|/ |/| | | | Stacktraces with CRTDBG memory leaks on Windows
| * | | | Include stacktrace summary in memory leak output.Jeff Hostetler2015-06-293-19/+170
| | | | |
* | | | | Merge pull request #3287 from ethomson/filter_test_cleanupCarlos Martín Nieto2015-07-021-6/+1
|\ \ \ \ \ | | | | | | | | | | | | filter::stream: free the filter sanely
| * | | | | filter::stream: free the filter sanelyEdward Thomson2015-07-021-6/+1
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | Don't use the filter's free callback to free the actual data structure holding the filter, as we may not always actually initialize it (the test may be skipped).
* | | | | submodule: add failing test for loading the wrong submoduleCarlos Martín Nieto2015-07-011-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | When two submodules are fairly similar, we may end up loading the wrong one.
* | | | | submodule: completely remove reload_allCarlos Martín Nieto2015-07-011-2/+0
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function was removed, but its declaration and changelog entry about its removal were forgotten. The comment in the test doesn't make any sense as the function doesn't exist anymore, so get rid of it as well.
* | | | index tests: add eol to avoid compiler warningEdward Thomson2015-06-301-1/+1
| | | |
* | | | checkout test: mark unused varsEdward Thomson2015-06-301-1/+4
| |/ / |/| |
* | | Merge pull request #3270 from ethomson/warnings2Carlos Martín Nieto2015-06-305-5/+6
|\ \ \ | |/ / |/| | Remove some warnings
| * | checkout test: check getcwd return valueEdward Thomson2015-06-291-1/+1
| | |
| * | clar: test chdirEdward Thomson2015-06-291-1/+1
| | |
| * | filter test: pass base typeEdward Thomson2015-06-291-2/+2
| | |
| * | stash: const up conflict paramsEdward Thomson2015-06-291-1/+1
| | |
| * | index test: include repository.h for declEdward Thomson2015-06-291-0/+1
| | |
* | | submodule: remove trailing slashes from submodule pathsCarlos Martín Nieto2015-06-291-0/+3
|/ / | | | | | | | | We allow looking up a submodule by path, but we lost the path normalisation during the recent changes. Bring it back.
* | Merge pull request #3265 from libgit2/leaksCarlos Martín Nieto2015-06-274-7/+27
|\ \ | | | | | | Plug a bunch of leaks