summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* submodule: add a test for a renamed submdoule dircmn/submodule-refactorCarlos Martín Nieto2015-09-101-0/+55
|
* futils: ensure we can write a hidden fileEdward Thomson2015-09-081-0/+68
|
* filebuf: ensure we can lock a hidden fileEdward Thomson2015-09-081-0/+26
|
* Merge pull request #3353 from ethomson/wrongcase_addCarlos Martín Nieto2015-09-082-0/+199
|\ | | | | index: canonicalize directory case when adding
| * git_index_add: allow case changing renamesEdward Thomson2015-09-082-0/+51
| | | | | | | | | | | | | | | | | | | | | | On case insensitive platforms, allow `git_index_add` to provide a new path for an existing index entry. Previously, we would maintain the case in an index entry without the ability to change it (except by removing an entry and re-adding it.) Higher-level functions (like `git_index_add_bypath` and `git_index_add_frombuffers`) continue to keep the old path for easier usage.
| * index: canonicalize directory case when addingEdward Thomson2015-09-081-0/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On case insensitive systems, when given a user-provided path in the higher-level index addition functions (eg `git_index_add_bypath` / `git_index_add_frombuffer`), examine the index to try to match the given path to an existing directory. Various mechanisms can cause the on-disk representation of a folder to not match the representation in HEAD or the index - for example, a case changing rename of some file `a/file.txt` to `A/file.txt` will update the paths in the index, but not rename the folder on disk. If a user subsequently adds `a/other.txt`, then this should be stored in the index as `A/other.txt`.
* | Merge pull request #3381 from leoyanggit/index_directory_iteratorEdward Thomson2015-09-081-0/+21
|\ \ | |/ |/| New feature: add the ablility to iterate through a directory in index
| * New API: git_index_find_prefixLeo Yang2015-09-041-0/+21
| | | | | | | | Find the first index entry matching a prefix.
* | Merge pull request #3413 from libgit2/cmn/follow-symlinkEdward Thomson2015-09-061-0/+53
|\ \ | | | | | | filebuf: follow symlinks when creating a lock file
| * | filebuf: follow symlinks when creating a lock filecmn/follow-symlinkCarlos Martín Nieto2015-09-051-0/+53
| |/ | | | | | | | | | | | | We create a lockfile to update files under GIT_DIR. Sometimes these files are actually located elsewhere and a symlink takes their place. In that case we should lock and update the file at its final location rather than overwrite the symlink.
* | Merge pull request #3366 from libgit2/cmn/index-hashmapEdward Thomson2015-09-062-0/+34
|\ \ | |/ |/| Use a hashmap for path-based lookups in the index
| * index: add tests around case switchingCarlos Martín Nieto2015-08-142-0/+34
| | | | | | | | | | We were missing tests for switching the case-sensitivity of an index in-memory and then looking up entries in it.
* | Merge pull request #3402 from ethomson/faster_diffCarlos Martín Nieto2015-09-017-162/+962
|\ \ | | | | | | Provide path matching in the iterators (for faster diffs)
| * | iterator test: handle case (in)sensitivityEdward Thomson2015-08-311-3/+26
| | |
| * | iterator test: use new iter opts in fifo testEdward Thomson2015-08-311-2/+5
| | |
| * | iterator: saner pathlist matching for idx iteratorEdward Thomson2015-08-312-24/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some nicer refactoring for index iteration walks. The index iterator doesn't binary search through the pathlist space, since it lacks directory entries, and would have to binary search each index entry and all its parents (eg, when presented with an index entry of `foo/bar/file.c`, you would have to look in the pathlist for `foo/bar/file.c`, `foo/bar` and `foo`). Since the index entries and the pathlist are both nicely sorted, we walk the index entries in lockstep with the pathlist like we do for other iteration/diff/merge walks.
| * | status test: brackets are now literalEdward Thomson2015-08-301-2/+2
| | |
| * | tree_iterator: use a pathlistEdward Thomson2015-08-301-0/+114
| | |
| * | diff: use new iterator pathlist handlingEdward Thomson2015-08-302-7/+36
| | | | | | | | | | | | | | | | | | | | | | | | When using literal pathspecs in diff with `GIT_DIFF_DISABLE_PATHSPEC_MATCH` turn on the faster iterator pathlist handling. Updates iterator pathspecs to include directory prefixes (eg, `foo/`) for compatibility with `GIT_DIFF_DISABLE_PATHSPEC_MATCH`.
| * | diff: better document GIT_DIFF_PATHSPEC_DISABLEEdward Thomson2015-08-281-0/+210
| | | | | | | | | | | | | | | | | | Document that `GIT_DIFF_PATHSPEC_DISABLE` is not necessarily about explicit path matching, but also includes matching of directory names. Enforce this in a test.
| * | iterator: sort subdirs properly with pathlistEdward Thomson2015-08-281-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When given a pathlist, don't assume that directories sort before files. Walk through any list of entries sorting before us to make sure that we've exhausted all entries that *aren't* directories. Eg, if we're searching for 'foo/bar', and we have a 'foo.c', keep advancing the pathlist to keep looking for an entry prefixed with 'foo/'.
| * | Move filelist into the iterator handling itself.Edward Thomson2015-08-281-0/+248
| | |
| * | iterator: use an options struct instead of argsEdward Thomson2015-08-285-158/+279
| | |
* | | Merge pull request #3352 from ethomson/hiddenEdward Thomson2015-08-282-0/+61
|\ \ \ | |/ / |/| | win32: ensure hidden files can be staged
| * | win32: ensure hidden files can be stagedEdward Thomson2015-08-032-0/+61
| | |
* | | diff: don't error out on an invalid regexcmn/regex-nofailCarlos Martín Nieto2015-08-151-0/+26
| | | | | | | | | | | | | | | | | | When parsing user-provided regex patterns for functions, we must not fail to provide a diff just because a pattern is not well formed. Ignore it instead.
* | | Merge pull request #3168 from libgit2/cmn/config-txEdward Thomson2015-08-131-0/+50
|\ \ \ | | | | | | | | Locking and transactional/atomic updates for config
| * | | 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.
* | | remote: add failing test for a mirror refspecCarlos Martín Nieto2015-08-111-5/+34
|/ / | | | | | | | | | | While we download the remote's remote-tracking branches, we don't download the tag. This points to the tag auto-follow rules interfering with the refspec.
* | 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.