summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* config: add a ProgramData levelcmn/programdata-configCarlos Martín Nieto2015-10-211-0/+40
| | | | | This is where portable git stores the global configuration which we can use to adhere to it even though git isn't quite installed on the system.
* Merge pull request #3466 from libgit2/cmn/quick-parse-64Edward Thomson2015-10-151-0/+35
|\ | | | | revwalk: make commit list use 64 bits for time
| * revwalk: make commit list use 64 bits for timecmn/quick-parse-64Carlos Martín Nieto2015-10-141-0/+35
| | | | | | | | | | | | | | | | We moved the "main" parsing to use 64 bits for the timestamp, but the quick parsing for the revwalk did not. This means that for large timestamps we fail to parse the time and thus the walk. Move this parser to use 64 bits as well.
* | Merge pull request #3444 from ethomson/add_preserves_conflict_modeCarlos Martín Nieto2015-10-151-0/+88
|\ \ | | | | | | Preserve modes from a conflict in `git_index_insert`
| * | index: also try conflict mode when insertingEdward Thomson2015-09-301-1/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we do not trust the on-disk mode, we use the mode of an existing index entry. This allows us to preserve executable bits on platforms that do not honor them on the filesystem. If there is no stage 0 index entry, also look at conflicts to attempt to answer this question: prefer the data from the 'ours' side, then the 'theirs' side before falling back to the common ancestor.
| * | index: test that add_bypath preserves modeEdward Thomson2015-09-291-0/+23
| | |
* | | odb: Prioritize alternate backendsvmg/odb-lookupsVicent Marti2015-10-141-8/+8
| |/ |/| | | | | | | | | | | | | | | | | | | | | For most real use cases, repositories with alternates use them as main object storage. Checking the alternate for objects before the main repository should result in measurable speedups. Because of this, we're changing the sorting algorithm to prioritize alternates *in cases where two backends have the same priority*. This means that the pack backend for the alternate will be checked before the pack backend for the main repository *but* both of them will be checked before any loose backends.
* | diff: don't feed large files to xdiffEdward Thomson2015-10-051-3/+3
| |
* | merge_file: treat large files as binaryEdward Thomson2015-10-051-0/+88
| | | | | | | | | | | | | | | | xdiff craps the bed on large files. Treat very large files as binary, so that it doesn't even have to try. Refactor our merge binary handling to better match git.git, which looks for a NUL in the first 8000 bytes.
* | refdb and odb backends must provide `free` functionArthur Schreiber2015-10-011-0/+1
| | | | | | | | | | | | | | | | | | As refdb and odb backends can be allocated by client code, libgit2 can’t know whether an alternative memory allocator was used, and thus should not try to call `git__free` on those objects. Instead, odb and refdb backend implementations must always provide their own `free` functions to ensure memory gets freed correctly.
* | Merge pull request #3411 from spraints/custom-push-headersCarlos Martín Nieto2015-09-306-17/+44
|\ \ | | | | | | Include custom HTTP headers
| * | Add a test for custom header validationMatt Burke2015-09-101-0/+27
| | | | | | | | | | | | Also, *some* custom headers actually are valid.
| * | Tell the git_transport about the custom_headersMatt Burke2015-09-085-17/+17
| | |
* | | win32::longpath: don't print pathlongpath-printfEdward Thomson2015-09-281-2/+0
| |/ |/|
* | Merge pull request #3441 from libgit2/cmn/badsslEdward Thomson2015-09-281-0/+27
|\ \ | | | | | | net: add tests against badssl.com
| * | 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.
* | | Plug some leaksCarlos Martín Nieto2015-09-272-0/+7
|/ /
* | 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