summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* net: add tests against badssl.comcmn/badsslCarlos Martín Nieto2015-09-271-0/+27
| | | | | These provide bad X.509 certificates, which we should refuse to connect to by default.
* Fix binary diffsGuille -bisho-2015-09-251-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git expects an empty line after the binary data: literal X ...binary data... <empty_line> The last literal block of the generated patches were not containing the required empty line. Example: diff --git a/binary_file b/binary_file index 3f1b3f9098131cfecea4a50ff8afab349ea66d22..86e5c1008b5ce635d3e3fffa4434c5eccd8f00b6 100644 GIT binary patch literal 8 Pc${NM&PdElPvrst3ey5{ literal 6 Nc${NM%g@i}0ssZ|0lokL diff --git a/binary_file2 b/binary_file2 index 31be99be19470da4af5b28b21e27896a2f2f9ee2..86e5c1008b5ce635d3e3fffa4434c5eccd8f00b6 100644 GIT binary patch literal 8 Pc${NM&PdElPvrst3ey5{ literal 13 Sc${NMEKbZyOexL+Qd|HZV+4u- git apply of that diff results in: error: corrupt binary patch at line 9: diff --git a/binary_file2 b/binary_file2 fatal: patch with only garbage at line 10 The proper formating is: diff --git a/binary_file b/binary_file index 3f1b3f9098131cfecea4a50ff8afab349ea66d22..86e5c1008b5ce635d3e3fffa4434c5eccd8f00b6 100644 GIT binary patch literal 8 Pc${NM&PdElPvrst3ey5{ literal 6 Nc${NM%g@i}0ssZ|0lokL diff --git a/binary_file2 b/binary_file2 index 31be99be19470da4af5b28b21e27896a2f2f9ee2..86e5c1008b5ce635d3e3fffa4434c5eccd8f00b6 100644 GIT binary patch literal 8 Pc${NM&PdElPvrst3ey5{ literal 13 Sc${NMEKbZyOexL+Qd|HZV+4u-
* win32: test checkout msg on long path errEdward Thomson2015-09-231-0/+62
|
* Merge pull request #3434 from ethomson/reservednamesCarlos Martín Nieto2015-09-2123-0/+69
|\ | | | | Win32 Reserved names: don't reserve names outside the working directory
| * repo::reservedname: test a submodule updateEdward Thomson2015-09-1823-0/+69
| | | | | | | | | | | | | | Test an initial submodule update, where we are trying to checkout the submodule for the first time, and placing a file within the submodule working directory with the same name as the submodule (and consequently, the same name as the repository itself).
* | config: test that comments are left as with gitLinquize2015-09-181-3/+8
| |
* | Fix a couple of warningsCarlos Martín Nieto2015-09-182-2/+1
| |
* | mkdir: find component paths for mkdir_relativeEdward Thomson2015-09-171-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | `git_futils_mkdir` does not blindly call `git_futils_mkdir_relative`. `git_futils_mkdir_relative` is used when you have some base directory and want to create some path inside of it, potentially removing blocking symlinks and files in the process. This is not suitable for a general recursive mkdir within the filesystem. Instead, when `mkdir` is being recursive, locate the first existent parent directory and use that as the base for `mkdir_relative`.
* | core::mkdir tests: ensure we don't stomp symlinks in mkdirEdward Thomson2015-09-171-0/+34
| | | | | | | | | | In `mkdir` and `mkdir_r`, ensure that we don't try to remove symlinks that are in our way.
* | core::mkdir tests: include absolute mkdirsEdward Thomson2015-09-171-0/+35
| |
* | git_futils_mkdir_*: make a relative-to-base mkdirEdward Thomson2015-09-1716-73/+73
|/ | | | | | | | | | | | Untangle git_futils_mkdir from git_futils_mkdir_ext - the latter assumes that we own everything beneath the base, as if it were being called with a base of the repository or working directory, and is tailored towards checkout and ensuring that there is no bogosity beneath the base that must be cleaned up. This is (at best) slow and (at worst) unsafe in the larger context of a filesystem where we do not own things and cannot do things like unlink symlinks that are in our way.
* checkout: overwrite files with differing modesEdward Thomson2015-09-161-1/+2
| | | | | | | | | | | When a file exists on disk and we're checking out a file that differs in executableness, remove the old file. This allows us to recreate the new file with p_open, which will take the new mode into account and handle setting the umask properly. Remove any notion of chmod'ing existing files, since it is now handled by the aforementioned removal and was incorrect, as it did not take umask into account.
* checkout::tree tests: don't use hardcoded modeEdward Thomson2015-09-161-8/+8
|
* checkout::tree tests: don't use static bufferEdward Thomson2015-09-161-6/+9
|
* Check that checkout preserves filemode in working directory.Matti Virolainen2015-09-161-0/+63
|
* Check that an executable in index is not an executable after checkout.Matti Virolainen2015-09-161-0/+11
|
* cl_git_path_url: assert sane static buffer sizeEdward Thomson2015-09-141-0/+2
|
* clone::nonetwork: don't use fixed size bufferEdward Thomson2015-09-141-3/+6
|
* Merge pull request #3425 from ethomson/diriter_rootCarlos Martín Nieto2015-09-131-0/+29
|\ | | | | Handle `git_path_diriter` instances at the drive root on Windows
| * diriter: test we can iterate rootEdward Thomson2015-09-131-0/+29
| | | | | | | | | | | | Ensure that we can iterate the filesystem root and that paths come back well-formed, not with an additional '/'. (eg, when iterating `c:/`, expect that we do not get some path like `c://autoexec.bat`).
* | Merge pull request #3423 from libgit2/cmn/push-tests-inline-oidCarlos Martín Nieto2015-09-133-11/+6
|\ \ | |/ |/| push: put the git_oid inline in the test structure
| * push: put the git_oid inline in the test structurecmn/push-tests-inline-oidCarlos Martín Nieto2015-09-133-11/+6
| | | | | | | | | | | | These are small pieces of data, so there is no advantage to allocating them separately. Include the two ids inline in the struct we use to check that the expected and actual ids match.
* | Don't free config in `git_transaction_commit`.Arthur Schreiber2015-09-131-0/+10
| | | | | | | | The config is not owned by the transaction, so please don’t free it.
* | Merge branch 'cmn/ignore-dir-check'Carlos Martín Nieto2015-09-131-0/+17
|\ \
| * | ignore: add test and adjust style and comment for dir with wildmatchCarlos Martín Nieto2015-09-131-0/+17
| | | | | | | | | | | | | | | | | | The previous commit left the comment referencing the earlier state of the code, change it to explain the current logic. While here, change the logic to avoid repeating the copy of the base pattern.
* | | Merge pull request #3370 from libgit2/cmn/submodule-refactorCarlos Martín Nieto2015-09-131-0/+55
|\ \ \ | |_|/ |/| | submodule: refactor to be more explicit in the search
| * | submodule: add a test for a renamed submdoule dircmn/submodule-refactorCarlos Martín Nieto2015-09-101-0/+55
| | |
* | | diff::workdir: ensure ignored files are not returnedEdward Thomson2015-09-121-0/+43
|/ / | | | | | | | | Ensure that a diff with the workdir is not erroneously returning directories.
* | 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
| | |/ | |/|