summaryrefslogtreecommitdiff
path: root/tests/status
Commit message (Collapse)AuthorAgeFilesLines
* diff: check files with the same or newer timestampsCarlos Martín Nieto2015-06-221-0/+2
| | | | | | | | | | When a file on the workdir has the same or a newer timestamp than the index, we need to perform a full check of the contents, as the update of the file may have happened just after we wrote the index. The iterator changes are such that we can reach inside the workdir iterator from the diff, though it may be better to have an accessor instead of moving these structs into the header.
* status: test that symlinks don't lose their modeEdward Thomson2015-06-201-0/+48
| | | | | | Test to ensure that when status updates an index, it does not alter the original mode for file types that are not supported (eg, symlinks on Windows).
* tests: tick the index when we count OID calculationsCarlos Martín Nieto2015-06-161-0/+6
| | | | | | | | | These tests want to test that we don't recalculate entries which match the index already. This is however something we force when truncating racily-clean entries. Tick the index forward as we know that we don't perform the modifications which the racily-clean code is trying to avoid.
* Fixed build warnings on Xcode 6.1Pierre-Olivier Latour2015-06-021-2/+2
|
* diff conflicts: don't include incorrect IDEdward Thomson2015-05-281-0/+46
| | | | | | | | | Since a diff entry only concerns a single entry, zero the information for the index side of a conflict. (The index entry would otherwise erroneously include the lowest-stage index entry - generally the ancestor of a conflict.) Test that during status, the index side of the conflict is empty.
* diff/status: introduce conflictsEdward Thomson2015-05-281-2/+2
| | | | | | | | | | | When diffing against an index, return a new `GIT_DELTA_CONFLICTED` delta type for items that are conflicted. For a single file path, only one delta will be produced (despite the fact that there are multiple entries in the index). Index iterators now have the (optional) ability to return conflicts in the index. Prior to this change, they would be omitted, and callers (like diff) would omit conflicted index entries entirely.
* index: validate mode of new conflictsEdward Thomson2015-05-281-0/+6
|
* conflicts: when adding conflicts, remove stagedEdward Thomson2015-05-281-1/+1
| | | | | | When adding a conflict for some path, remove the staged entry. Otherwise, an illegal index (with both stage 0 and high-stage entries) would result.
* ignore: clear the error when matching a pattern negationcmn/ignored-ignoreCarlos Martín Nieto2015-05-201-0/+12
| | | | | | When we discover that we want to keep a negative rule, make sure to clear the error variable, as it we otherwise return whatever was left by the previous loop iteration.
* status test: always test the new file pathEdward Thomson2015-05-041-8/+12
|
* ignore: fix negative ignores without wildcards.Patrick Steinhardt2015-04-171-0/+53
|
* repository: remove log message override for switching the active branchCarlos Martín Nieto2015-03-031-1/+1
| | | | | | We want to use the "checkout: moving from ..." message in order to let git know when a change of branch has happened. Make the convenience functions for this goal write this message.
* Remove the signature from ref-modifying functionsCarlos Martín Nieto2015-03-031-2/+2
| | | | | | | | | | The signature for the reflog is not something which changes dynamically. Almost all uses will be NULL, since we want for the repository's default identity to be used, making it noise. In order to allow for changing the identity, we instead provide git_repository_set_ident() and git_repository_ident() which allow a user to override the choice of signature.
* ignore: adjust test for negating inside a dirCarlos Martín Nieto2014-12-051-5/+14
| | | | | | | | | | | | | Given top !top/foo in an ignore file, we should not unignore top/foo. This is an implementation detail of the git code leaking, but that's the behaviour we should show. A negation rule can only negate an exact rule it has seen before.
* Plug leaksCarlos Martín Nieto2014-11-231-0/+1
| | | | Valgrind is now clean except for libssl and libgcrypt.
* Fixed a couple Clang warningsPierre-Olivier Latour2014-11-101-1/+0
|
* git_status_file now takes an exact pathUngureanu Marius2014-11-071-3/+1
| | | | | | This function has one output but can match multiple files, which can be unexpected for the user, which would usually path the exact path of the file he wants the status of.
* submodules: add failing test for stale module entriesCarlos Martín Nieto2014-11-071-0/+48
| | | | | | | | | We consider an entry in .gitmodules to mean that we have a submodule at a particular path, even if HEAD^{tree} and the index do not contain any reference to it. We should ignore that submodule entry and simply consider that path to be a regular directory.
* ignore: add failing test for a file mentioning the parentCarlos Martín Nieto2014-11-061-0/+32
| | | | | When we mention "src" in src/.gitignore, we wrongly consider src/ itself to be ignored.
* ignore: consider files with a CR in their namescmn/ignore-file-trailing-crCarlos Martín Nieto2014-11-051-0/+32
| | | | | | | | | | We currently consider CR to start the end of the line, but that means that we miss cases with CR CR LF which can be used with git to match files whose names have CR at the end of their names. The fix from the patch comes from Russell's comment in the issue. This fixes #2536.
* Merge pull request #2508 from libgit2/rb/fix-ignore-slash-starVicent Marti2014-08-261-0/+95
|\ | | | | Fix bugs with negative ignores inside an ignored parent directory
| * Demonstrate a trailing slash failure.rb/fix-ignore-slash-starRob Rix2014-08-081-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `git help ignore` has this to say about trailing slashes: > If the pattern ends with a slash, it is removed for the purpose of > the following description, but it would only find a match with a > directory. In other words, foo/ will match a directory foo and > paths underneath it, but will not match a regular file or a > symbolic link foo (this is consistent with the way how pathspec > works in general in Git). Sure enough, having manually performed the same steps as this test, `git status` tells us the following: # On branch master # # Initial commit # # Changes to be committed: # (use "git rm --cached <file>..." to unstage) # # new file: force.txt # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # ../.gitignore # child1/ # child2/ i.e. neither child1 nor child2 is ignored.
| * status: failing test with slash-starCarlos Martín Nieto2014-08-081-0/+38
| | | | | | | | | | | | | | When writing 'bin/*' in the rules, this means we ignore very file inside bin/ individually, but do not ignore the directory itself. Thus the status listing should list both files under bin/, one untracked and one ignored.
* | Don't include the unreadable tests on win32Edward Thomson2014-08-131-0/+4
|/
* Merge remote-tracking branch 'origin/master' into ↵Alan Rogers2014-07-221-2/+2
|\ | | | | | | fix-git-status-list-new-unreadable-folder
| * Introduce cl_assert_equal_oidEdward Thomson2014-07-011-2/+2
| |
* | Merge remote-tracking branch 'origin/development' into ↵Alan Rogers2014-06-041-0/+107
|\ \ | |/ | | | | | | | | | | fix-git-status-list-new-unreadable-folder Conflicts: include/git2/diff.h
| * Improve checks for ignore containmentrb/how-broken-can-ignores-beRussell Belfer2014-05-061-0/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The diff code was using an "ignored_prefix" directory to track if a parent directory was ignored that contained untracked files alongside tracked files. Unfortunately, when negative ignore rules were used for directories inside ignored parents, the wrong rules were applied to untracked files inside the negatively ignored child directories. This commit moves the logic for ignore containment into the workdir iterator (which is a better place for it), so the ignored-ness of a directory is contained in the frame stack during traversal. This allows a child directory to override with a negative ignore and yet still restore the ignored state of the parent when we traverse out of the child. Along with this, there are some problems with "directory only" ignore rules on container directories. Given "a/*" and "!a/b/c/" (where the second rule is a directory rule but the first rule is just a generic prefix rule), then the directory only constraint was having "a/b/c/d/file" match the first rule and not the second. This was fixed by having ignore directory-only rules test a rule against the prefix of a file with LEADINGDIR enabled. Lastly, spot checks for ignores using `git_ignore_path_is_ignored` were tested from the top directory down to the bottom to deal with the containment problem, but this is wrong. We have to test bottom to top so that negative subdirectory rules will be checked before parent ignore rules. This does change the behavior of some existing tests, but it seems only to bring us more in line with core Git, so I think those changes are acceptable.
* | Add another test for unreadable and not included.Alan Rogers2014-06-041-0/+32
| |
* | Add GIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKEDAlan Rogers2014-06-031-1/+36
| | | | | | | | and a (failing) test for it.
* | Fix the no permissions test.Alan Rogers2014-05-301-3/+2
| |
* | Use 'X' for unreadable status.Alan Rogers2014-05-301-0/+3
| |
* | We do expect the foo path in the nopermissions testAlan Rogers2014-05-231-2/+2
| |
* | Remove errant newlineAlan Rogers2014-05-221-1/+0
| |
* | Simplify the no permission test.Alan Rogers2014-05-211-6/+4
| |
* | Skip unreadable files for now.Alan Rogers2014-05-151-2/+5
| |
* | Simplify the test.Alan Rogers2014-05-151-10/+5
| |
* | Add a test (failing) for a work tree status.Alan Rogers2014-05-141-0/+38
|/ | | | | When thees is an unreadable folder, we should still be able to enumerate status.
* Improve handling of fake home directoryRussell Belfer2014-05-021-4/+1
| | | | | | | | | | There are a few tests that set up a fake home directory and a fake GLOBAL search path so that we can test things in global ignore or attribute or config files. This cleans up that code to work more robustly even if there is a test failure. This also fixes some valgrind warnings where scanning search paths for separators could end up doing a little bit of sketchy data access when coming to the end of search list.
* Remove trace / add git_diff_perfdata struct + apiRussell Belfer2014-05-021-39/+36
|
* Add payloads, bitmaps to trace APIRussell Belfer2014-05-021-27/+5
| | | | | | | | | This is a proposed adjustment to the trace APIs. This makes the trace levels into a bitmask so that they can be selectively enabled and adds a callback-level payload, plus a message-level payload. This makes it easier for me to a GIT_TRACE_PERF callbacks that are simply bypassed if the PERF level is not set.
* Don't use trace if GIT_TRACE not definedRussell Belfer2014-05-021-0/+6
|
* Add GIT_STATUS_OPT_UPDATE_INDEX and use trace APIRussell Belfer2014-05-021-7/+84
| | | | | | This adds an option to refresh the stat cache while generating status. It also rips out the GIT_PERF stuff I had an makes use of the trace API to keep statistics about what happens during diff.
* Skip diff oid calc when size definitely changedRussell Belfer2014-05-021-1/+5
| | | | | | | | | | | | | When we think the stat cache in the index seems valid and the size or mode of a file has definitely changed, then don't bother trying to recalculate the OID of the workdir bits to confirm that it is modified - just accept that it is modified. This can result in files that show as modified with no actual diff, but the behavior actually appears to match Git on the command line. This also includes a minor optimization to not perform a submodule lookup on the ".git" directory itself.
* Improve docs for status rename detection limitsrb/status-with-precomposed-changesRussell Belfer2014-04-241-2/+5
| | | | and make tests empty on platforms without iconv support.
* Test toggling core.precomposeunicode yields renameRussell Belfer2014-04-241-0/+69
| | | | | | | | | There is an interesting difference with core Git here, though. Because libgit2 will do rename detection with the working directory, in the last case where the HEAD and the working directory both have the decomposed data and the index has the composed data, we generate a single status record with two renames whereas Git will generate one rename (head to index) and one untracked file.
* Test decomposed unicode renames work as expectedRussell Belfer2014-04-241-37/+92
|
* Fix ignore difference from git with trailing /*Russell Belfer2014-04-181-0/+18
| | | | | | | | | Ignore patterns that ended with a trailing '/*' were still needing to match against another actual '/' character in the full path. This is not the same behavior as core Git. Instead, we strip a trailing '/*' off of any patterns that were matching and just take it to imply the FNM_LEADING_DIR behavior.
* Cleanup tests with helper functionsRussell Belfer2014-04-181-153/+82
|
* Pop ignore only if whole relative path matchesRussell Belfer2014-04-182-29/+70
| | | | | | | | | | | When traversing the directory structure, the iterator pushes and pops ignore files using a vector. Some directories don't have ignore files, so it uses a path comparison to decide when it is right to actually pop the last ignore file. This was only comparing directory suffixes, though, so a subdirectory with the same name as a parent could result in the parent's .gitignore being popped off the list ignores too early. This changes the logic to compare the entire relative path of the ignore file.