summaryrefslogtreecommitdiff
path: root/tests/resources
Commit message (Collapse)AuthorAgeFilesLines
* attr: ensure regular attr files can have whitespaceethomson/ignore_spacesEdward Thomson2019-05-241-0/+7
| | | | | | Unlike ignore files, gitattribute files can have flexible whitespace at the beginning of the line. Ensure that by adding new ignore rules that we have not impeded correct parsing of attribute files.
* index: preserve extension parsing errorsEtienne Samson2019-01-247-0/+15
| | | | | | | Previously, we would clobber any extension-specific error message with an "extension is truncated" message. This makes `read_extension` correctly preserve those errors, takes responsibility for truncation errors, and adds a new message with the actual extension signature for unsupported mandatory extensions.
* Convert tests/resources/push.sh to LF endingslhchavez2019-01-151-55/+55
| | | | | This changes that file to use UNIX line-endings, which makes sense since this is a UNIXy file.
* Get rid of some test files that were accidentally committedTyler Wanek2019-01-142151-11979/+0
|
* crlf_data: add corpus of known-good odb-filtered dataEdward Thomson2018-12-036257-0/+32690
| | | | | | | | | | Use the crlf data scripts to produce a corpus of known-good data in "git" format (aka ODB format) from a variety of files with different line endings. `git` created these files running `git add` to stage the contents then extracting the data from the repository. We'll use these to ensure that we create identical contents when we add files into the index.
* crlf: re-use existing crlf script to create odbEdward Thomson2018-12-0322-118/+63
| | | | | | Re-use the existing crlf data generation script for creating the to-odb dataset. Also, store the actual file contents instead of the ID so that we can identify differences instead of detecting that differences exist.
* crlf: script to generate expected crlf data for adding files to indexSven Strickroth2018-12-0322-3/+232
| | | | | | | | | | Include a shell script that will generate the expected data of OIDs and failures for calling git.git to capture its output as a test resource. Right now, there is no need to differentiate different systems as git behaves the same on all systems IIRC. Signed-off-by: Sven Strickroth <email@cs-ware.de>
* crlf_data: move to a "to_workdir" folderEdward Thomson2018-12-031370-3/+4
| | | | | | | Move the crlf_data folders reponsible for holding the state of the filters going into the working directory to "to_workdir" variations of the folder name to accommodate future growth into the "to odb" filter variation. Update the script to create these new folders as appopriate.
* apply tests: ensure we can patch a modified fileEdward Thomson2018-11-051-0/+0
| | | | | | | | Patch application need not be on an unmodified file; applying to an already changed file is supported provided the patch still applies cleanly. Add tests that modifies the contents of a file then applies the patch and ensures that the patch applies cleanly, and the original changes are also kept.
* checkout: fix test fixture missing objectscmn/validity-tree-from-unowned-indexEdward Thomson2018-10-203-0/+0
| | | | | | | | | | | | | | | The testrepo test fixture has an index file that's damaged, missing an object. The index previously had an entry of `src/index.c` with id 3161df8cbf3a006b4ef85be6497a0ea6bde98541, but that object was missing in the repository. This commit adds an object to the repository and updates the index to use that existing blob. Similarly, the index has an entry for `readme` with an id of 97328ac7e3bd0bcd3900cb3e7a624d71dd0df888. This can be restored from other test repositories. With these fixed, now the write tree from index tests can pass since they validate object existence.
* tests: verify diff stats with renames in subdirectoryPatrick Steinhardt2018-10-0412-1/+8
| | | | | | | | | | | Until now, we didn't have any tests that verified that our format for renames in subdirectories is correct. While our current behaviour is no different than for renames that do not happen with a common prefix shared between old and new file name, we intend to change the format to instead match the format that upstream git uses. Add a test case for this to document our current behaviour and to show how the next commit will change that format.
* Merge pull request #4727 from libgit2/cmn/null-oid-existing-treeEdward Thomson2018-08-261-0/+0
|\ | | | | tree: accept null ids in existing trees when updating
| * tree: accept null ids in existing trees when updatingCarlos Martín Nieto2018-07-181-0/+0
| | | | | | | | | | | | | | | | | | When we add entries to a treebuilder we validate them. But we validate even those that we're adding because they exist in the base tree. This disables using the normal mechanisms on these trees, even to fix them. Keep track of whether the entry we're appending comes from an existing tree and bypass the name and id validation if it's from existing data.
* | Write a test.Nelson Elhage2018-08-141-0/+1
|/
* mailmap: Updates tests for new API and featuresNika Layzell2018-06-146-1/+5
|
* mailmap: Clean up the mailmap fixture's .gitted directoryNika Layzell2018-06-1413-543/+0
|
* mailmap: Add a bunch of tests for the new mailmap functionalityNika Layzell2018-06-1455-0/+596
|
* checkout: add a failing test for refusing a symlinked .gitmodulesCarlos Martín Nieto2018-05-225-0/+1
| | | | | We want to reject these as they cause compatibility issues and can lead to git writing to files outside of the repository.
* tests: add information about the crlf data generatorEdward Thomson2018-04-172-0/+87
| | | | | The CRLF data generator is somewhat obscure; add information about how to use it and what it does.
* tests: crlf: update POSIX test data to reflect Git 2.9+ behaviorSven Strickroth2018-04-1731-70/+70
| | | | | | Update with vanilla Git 2.11.0 on Debian Signed-off-by: Sven Strickroth <email@cs-ware.de>
* tests: crlf: update Windows test data to reflect Git 2.9+ behaviorSven Strickroth2018-04-1735-80/+80
| | | | | | Update with "git version 2.11.0.windows.3" Signed-off-by: Sven Strickroth <email@cs-ware.de>
* revwalk: fix uninteresting revs sometimes not limiting graphwalkPatrick Steinhardt2018-04-128-0/+17
| | | | | | | | | | | | | | | When we want to limit our graphwalk, we use the heuristic of checking whether the newest limiting (uninteresting) revision is newer than the oldest interesting revision. We do so by inspecting whether the first item's commit time of the user-supplied list of revisions is newer than the last added interesting revision. This is wrong though, as the user supplied list is in no way guaranteed to be sorted by increasing commit dates. This could lead us to abort the revwalk early before applying all relevant limiting revisions, outputting revisions which should in fact have been hidden. Fix the heuristic by instead checking whether _any_ of the limiting commits was made earlier than the last interesting commit. Add a test.
* testrepo: add new branchEdward Thomson2018-02-233-0/+3
| | | | | | Add a new branch to the `testrepo` repository, where the `README` file has changed to executable. This branch enables typechange tests between the new `executable` branch and `master`.
* tests: add rename-rewrite scenarios to "renames" repositoryPatrick Steinhardt2018-02-207-0/+3
| | | | | | | Add two more scenarios to the "renames" repository. The first scenario has a major rewrite of a file and a delete of another file, the second scenario has a deletion of a file and rename of another file to the deleted file. Both scenarios will be used in the following commit.
* Add failing test case for virtual commit merge base issueEdward Thomson2018-02-0426-0/+9
|
* Introduce additional criss-cross merge branchesEdward Thomson2018-02-0468-0/+11
|
* Do not attempt to check out submodule as blob when merging a submodule ↵David Turner2017-12-043-0/+3
| | | | modify/deltete conflict
* submodule: refuse lookup in bare repositoriesPatrick Steinhardt2017-08-2512-0/+13
| | | | | | | | | | | | | | While it is technically possible to look up submodules inside of a bare repository by reading the submodule configuration of a specific commit, we do not offer this functionality right now. As such, calling both `git_submodule_lookup` and `git_submodule_foreach` should error out early when these functions encounter a bare repository. While `git_submodule_lookup` already does return an error due to not being able to parse the configuration, `git_submodule_foreach` simply returns success and never invokes the callback function. Fix the issue by having both functions check whether the repository is bare and returning an error in that case.
* tests: fix the rebase-submodule testEtienne Samson2017-07-251-0/+0
|
* Remove invalid submoduleEtienne Samson2017-07-201-0/+0
| | | Fixes #4274
* tests: index::version: add test to read index version v4Patrick Steinhardt2017-06-0612-0/+7
| | | | | | | | While we have a simple test to determine whether we can write an index of version 4, we never verified that we are able to read this kind of index (and in fact, we were not able to do so). Add a new repository which has an index of version 4. This repository is then read from a new test.
* submodule: resolve URLs relative to main worktreePatrick Steinhardt2017-03-171-3/+0
| | | | | | | | | | | | | | | It is possible to specify submodule URLs relative to the repository location. E.g. having a submodule with URL "../submodule" will look for the submodule at "repo/../submodule". With the introduction of worktrees, though, we cannot simply resolve the URL relative to the repository location itself. If the repository for which a URL is to be resolved is a working tree, we have to resolve the URL relative to the parent's repository path. Otherwise, the URL would change depending on where the working tree is located. Fix this by special-casing when we have a working tree while getting the URL base.
* rebase: ignore untracked files in submodulesDavid Turner2017-03-0332-0/+122
| | | | | | | | | An untracked file in a submodule should not prevent a rebase from starting. Even if the submodule's SHA is changed, and that file would conflict with a new tracked file, it's still OK to start the rebase and discover the conflict later. Signed-off-by: David Turner <dturner@twosigma.com>
* hash: test for sha1 collision attack detectionEdward Thomson2017-03-032-0/+6
|
* Merge pull request #3436 from pks-t/libgit2-worktreeEdward Thomson2017-02-1339-0/+37
|\ | | | | Worktree implementation
| * tests: add merge-conflict branch for testrepoPatrick Steinhardt2017-02-134-0/+1
| | | | | | | | | | Add a new branch that causes a merge conflict to `testrepo` so that we are able to test merging in worktrees.
| * tests: add submodule worktree test dataPatrick Steinhardt2017-02-1323-0/+24
| | | | | | | | | | | | Create worktrees for submodule repositories. The worktrees are created for the parent repository (e.g. the one containing submodules) and for the contained child repository.
| * tests: add worktree test dataPatrick Steinhardt2017-02-1312-0/+12
| |
* | tests: fix permissions on testrepo.git index filePatrick Steinhardt2017-02-131-0/+0
|/
* Merge pull request #4111 from pks-t/pks/dos-prefixEdward Thomson2017-02-101-0/+0
|\ | | | | dirname with DOS prefixes
| * tests: repo: assert discovery starting at Win32 roots finishesPatrick Steinhardt2017-02-081-0/+0
| | | | | | | | | | | | | | | | | | | | As of recently, we failed to correctly discover repositories at a Win32 system root. Instead of aborting the upwards-traversal of the file system, we were looping infinitely when traversal started at either a Win32 drive prefix ("C:/") or a network path ("//somehost"). The issue has been fixed, so add a test to catch regressions.
* | merge_trees: introduce test for submodule renamesEdward Thomson2017-02-0916-0/+7
|/ | | | | Test that shows that submodules are incorrectly considered in renames, and `git_merge_trees` will fail to lookup the submodule as a blob.
* Merge branch 'pr/3809'Edward Thomson2016-10-099-1/+2
|\
| * make git_diff_stats_to_buf not show 0 insertions or 0 deletionsSim Domingo2016-10-099-1/+2
| |
* | revwalk: introduce tests that hide old commitsEdward Thomson2016-10-0613-0/+12
|/ | | | | | Introduce some tests that show some commits, while hiding some commits that have a timestamp older than the common ancestors of these two commits.
* rebase: test rebasing a new commit with subfolderEdward Thomson2016-06-026-0/+1
| | | | | Test a rebase (both a merge rebase and an inmemory rebase) with a new commit that adds files underneath a new subfolder.
* status: test submodules with mixed caseEdward Thomson2016-03-31227-0/+358
|
* tests: use legitimate object idsEdward Thomson2016-02-284-0/+0
| | | | | Use legitimate (existing) object IDs in tests so that we have the ability to turn on strict object validation when running tests.
* win32: tests around handling forbidden pathsEdward Thomson2016-02-1712-0/+23
| | | | | | | | | | | | | Introduce a repository that contains some paths that were illegal on PC-DOS circa 1981 (like `aux`, `con`, `com1`) and that in a bizarre fit of retrocomputing, remain illegal on some "modern" computers, despite being "new technology". Introduce some aspirational tests that suggest that we should be able to cope with trees and indexes that contain paths that would be illegal on the filesystem, so that we can at least diff them. Further ensure that checkout will not write a repository with forbidden paths.
* Merge pull request #3521 from pks-t/blame-line-overflowEdward Thomson2015-12-147-1/+1
|\ | | | | Line count overflow in git_blame_hunk and git_blame__entry