summaryrefslogtreecommitdiff
path: root/tests-clar/status
Commit message (Collapse)AuthorAgeFilesLines
* Make diff and status perform soft index reloadRussell Belfer2013-11-011-5/+4
| | | | | | | | | | | | | | | | | | | | | This changes `git_index_read` to have two modes - a hard index reload that always resets the index to match the on-disk data (which was the old behavior) and a soft index reload that uses the timestamp / file size information and only replaces the index data if the file on disk has been modified. This then updates the git_status code to do a soft reload unless the new GIT_STATUS_OPT_NO_REFRESH flag is passed in. This also changes the behavior of the git_diff functions that use the index so that when an index is not explicitly passed in (i.e. when the functions call git_repository_index for you), they will also do a soft reload for you. This intentionally breaks the file signature of git_index_read because there has been some confusion about the behavior previously and it seems like all existing uses of the API should probably be examined to select the desired behavior.
* Case sensitivity issues on LinuxRussell Belfer2013-10-081-7/+7
| | | | | | | | A couple of tests were actually dealing incorrectly with case sensitivity issues on Linux because they were relying on having core.ignorecase set to true. Now that the fixture initialization sets the case sensitivity to be accurate for the platform, it exposed bugs in these tests.
* Initial iconv hookup for precomposed unicodeRussell Belfer2013-10-031-1/+1
| | | | | | | | | | | | | | | | | | | | This hooks up git_path_direach and git_path_dirload so that they will take a flag indicating if directory entry names should be tested and converted from decomposed unicode to precomposed form. This code will only come into play on the Apple platform and even then, only when certain types of filesystems are used. This involved adding a flag to these functions which involved changing a lot of places in the code. This was an opportunity to do a bit of code cleanup here and there, for example, getting rid of the git_futils_cleanupdir_r function in favor of a simple flag to git_futils_rmdir_r to not remove the top level entry. That ended up adding depth tracking during rmdir_r which led to a safety check for infinite directory recursion. Yay. This hasn't actually been tested on the Mac filesystems where the issue occurs. I still need to get test environment for that.
* Add clar helper to create new commit from indexRussell Belfer2013-09-171-24/+1
| | | | | | | | There were a lot of places in the test code base that were creating a commit from the index on the current branch. This just adds a helper to handle that case pretty easily. There was only one test where this change ended up tweaking the test data, so pretty easy and mostly just a cleanup.
* Fixing up some win32 issues with autocrlfRussell Belfer2013-09-171-1/+3
|
* Rearrange clar submodule cleanup codeRussell Belfer2013-09-171-1/+0
|
* Split rewrites, status doesn't return rewritesEdward Thomson2013-08-281-0/+41
| | | | | | | | Ensure that we apply splits to rewrites, even if we're not interested in examining it closely for rename/copy detection. In keeping with core git, status should not display rewrites, it should simply show files as "modified".
* Merge pull request #1767 from libgit2/win32-bigger-utf8-bufferVicent Martí2013-08-132-0/+36
|\ | | | | Bigger buffer for utf-8 parsing in win32
| * Add checkout test for long file nameBen Straub2013-08-071-2/+2
| |
| * Don't use win32-only macro in test codeBen Straub2013-08-071-1/+1
| |
| * Add status test for long pathsBen Straub2013-08-072-0/+36
| |
* | Improve building ignore file listsRussell Belfer2013-08-091-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The routines to push and pop ignore files while traversing a directory had some issues. In particular, setting up the initial list would sometimes push an ignore file before it ought to be applied if the starting path was a directory containing an ignore file. Also, the pop function was not always matching the right part of the path and would fail to pop ignores from the list in some cases. This adds some tests that exercise a particular problematic case and then fixes the problems that I could find related to this. At some point, I'd like to isolate this ignore rule management code and rewrite it, but that's a larger project and right now, I'll opt to just try to fix the broken behaviors.
* | Merge pull request #1764 from ethomson/status_renames_from_rewritesRussell Belfer2013-08-091-0/+129
|\ \ | | | | | | Add rename from rewrites to status
| * | Add rename from rewrites to statusEdward Thomson2013-08-051-0/+129
| |/ | | | | | | | | | | In git_diff_paired_foreach, temporarily resort the index->workdir diff list by index path so that we can track a rename in the workdir from head->index->workdir.
* | Merge pull request #1462 from yorah/fix/libgit2sharp-issue-379Russell Belfer2013-08-091-0/+34
|\ \ | |/ |/| status: fix handling of filenames with special prefixes
| * status: fix handling of filenames with special prefixesyorah2013-04-151-0/+34
| | | | | | | | Fix libgit2/libgit2sharp#379
* | Untracked directories with .git should be ignoredRussell Belfer2013-07-101-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This restores a behavior that was accidentally lost during some diff refactoring where an untracked directory that contains a .git item should be treated as IGNORED, not as UNTRACKED. The submodule code already detects this, but the diff code was not handling the scenario right. This also updates a number of existing tests that were actually exercising the behavior but did not have the right expectations in place. It actually makes the new `test_diff_submodules__diff_ignore_options` test feel much better because the "not-a-submodule" entries are now ignored instead of showing up as untracked items. Fixes #1697
* | Remove GIT_STATUS_SHOW_INDEX_THEN_WORKDIR optionRussell Belfer2013-07-032-63/+0
| | | | | | | | | | | | This option serves no benefit now that the git_status_list API is available. It was of questionable value before and now it would just be a bad idea to use it rather than the indexed API.
* | Fix segfault in git_status_foreach_ext()yorah2013-07-032-0/+175
| | | | | | | | Add tests for the `GIT_STATUS_SHOW_XXX` flags.
* | Add status flags to force output sort orderRussell Belfer2013-06-203-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Files in status will, be default, be sorted according to the case insensitivity of the filesystem that we're running on. However, in some cases, this is not desirable. Even on case insensitive file systems, 'git status' at the command line will generally use a case sensitive sort (like 'ls'). Some GUIs prefer to display a list of file case insensitively even on case-sensitive platforms. This adds two new flags: GIT_STATUS_OPT_SORT_CASE_SENSITIVELY and GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY that will override the default sort order of the status output and give the user control. This includes tests for exercising these new options and makes the examples/status.c program emulate core Git and always use a case sensitive sort.
* | More tests and bug fixes for status with renameRussell Belfer2013-06-171-11/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the behavior of the status RENAMED flags so that they will be combined with the MODIFIED flags if appropriate. If a file is modified in the index and also renamed, then the status code will have both the GIT_STATUS_INDEX_MODIFIED and INDEX_RENAMED bits set. If it is renamed but the OID has not changed, then just the GIT_STATUS_INDEX_RENAMED bit will be set. Similarly, the flags GIT_STATUS_WT_MODIFIED and GIT_STATUS_WT_RENAMED can both be set independently of one another. This fixes a serious bug where the check for unmodified files that was done at data load time could end up erasing the RENAMED state of a file that was renamed with no changes. Lastly, this contains a bunch of new tests for status with renames, including tests where the only rename changes are case changes. The expected results of these tests have to vary by whether the platform uses a case sensitive filesystem or not, so the expected data covers those platform differences separately.
* | Improve case handling in git_diff__paired_foreachRussell Belfer2013-06-171-0/+48
| | | | | | | | | | | | | | | | This commit reinstates some changes to git_diff__paired_foreach that were discarded during the rebase (because the diff_output.c file had gone away), and also adjusts the case insensitively logic slightly to hopefully deal with either mismatched icase diffs and other case insensitivity scenarios.
* | handle renames in status computationEdward Thomson2013-06-171-0/+265
| |
* | Reorganize diff and add basic diff driverRussell Belfer2013-06-102-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a significant reorganization of the diff code to break it into a set of more clearly distinct files and to document the new organization. Hopefully this will make the diff code easier to understand and to extend. This adds a new `git_diff_driver` object that looks of diff driver information from the attributes and the config so that things like function content in diff headers can be provided. The full driver spec is not implemented in the commit - this is focused on the reorganization of the code and putting the driver hooks in place. This also removes a few #includes from src/repository.h that were overbroad, but as a result required extra #includes in a variety of places since including src/repository.h no longer results in pulling in the whole world.
* | Fix trailing whitespacesnulltoken2013-05-151-1/+0
| |
* | Improve ignore handling in git_status_fileRussell Belfer2013-05-101-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The git_status_file API was doing a hack to deal with files that are inside ignored directories. The status scan was not reporting any file in this case, so git_status_file would attempt a final "stat()" call, and return IGNORED if the file actually existed. On case-insensitive filesystems where core.ignorecase is set incorrectly, this magic check can "succeed" and report a file as ignored when it should actually return ENOTFOUND. Now that we have the GIT_STATUS_OPT_RECURSE_IGNORED_DIRS, we can use that flag to make sure that git_status_file() will look into ignored directories and eliminate the hack completely, so we give the correct error.
* | Update diff handling of untracked directoriesRussell Belfer2013-04-303-4/+5
| | | | | | | | | | | | | | | | | | | | When diff encounters an untracked directory, there was a shortcut that it took which is not compatible with core git. This makes the default behavior no longer take that shortcut and instead look inside the untracked directory to see if there are any untracked files within it. If there are not, then the directory is treated as an ignore directory instead of an untracked directory. This has implications for the git_status APIs.
* | Move some low-level repo fns to include/git2/sysRussell Belfer2013-04-211-2/+4
|/
* Tests and more fixes for submodule diffsRussell Belfer2013-04-091-1/+2
| | | | | | | | | | | | | This adds tests for diffs with submodules in them and (perhaps unsurprisingly) requires further fixes to be made. Specifically, this fixes: - when considering if a submodule is dirty in the workdir, it was being treated as dirty even if only the index was dirty. - git_diff_patch_to_str (and git_diff_patch_print) were "printing" the headers for files (and submodules) that were unmodified or had no meaningful content. - added comment to previous fix and removed unneeded parens.
* free!Edward Thomson2013-03-291-0/+2
|
* Fix some diff ignores and submodule dirty workdirRussell Belfer2013-03-254-15/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This started out trying to look at the problems from issue #1425 and gradually grew to a broader set of fixes. There are two core things fixed here: 1. When you had an ignore like "/bin" which is rooted at the top of your tree, instead of immediately adding the "bin/" entry as an ignored item in the diff, we were returning all of the direct descendants of the directory as ignored items. This changes things to immediately ignore the directory. Note that this effects the behavior in test_status_ignore__subdirectories so that we no longer exactly match core gits ignore behavior, but the new behavior probably makes more sense (i.e. we now will include an ignored directory inside an untracked directory that we previously would have left off). 2. When a submodule only contained working directory changes, the diff code was always considering it unmodified which was just an outright bug. The HEAD SHA of the submodule matches the SHA in the parent repo index, and since the SHAs matches, the diff code was overwriting the actual status with UNMODIFIED. These fixes broke existing tests test_diff_workdir__submodules and test_status_ignore__subdirectories but looking it over, I actually think the new results are correct and the old results were wrong. @nulltoken had actually commented on the subdirectory ignore issue previously. I also included in the tests some debugging versions of the shared iteration callback routines that print status or diff information. These aren't used actively in the tests, but can be quickly swapped in to test code to give a better picture of what is being scanned in some of the complex test scenarios.
* Implement GIT_STATUS_OPT_EXCLUDE_SUBMODULESRussell Belfer2013-03-252-13/+72
| | | | | | | | | | | This option has been sitting unimplemented for a while, so I finally went through and implemented it along with some tests. As part of this, I improved the implementation of GIT_DIFF_IGNORE_SUBMODULES so it be more diligent about avoiding extra work and about leaving off delta records for submodules to the greatest extent possible (though it may include them still if you are request TYPECHANGE records).
* Recursing into ignored dirs for diff and statusRussell Belfer2013-03-251-4/+59
| | | | | | | | This implements working versions of GIT_DIFF_RECURSE_IGNORED_DIRS and GIT_STATUS_OPT_RECURSE_IGNORED_DIRS along with some tests for the newly available behaviors. This is not turned on by default for status, but can be accessed via the options to the extended version of the command.
* Test fixes and cleanupRussell Belfer2013-03-251-4/+1
| | | | | | | | This fixes some places where the new tests were leaving the test area in a bad state or were freeing data they should not free. It also removes code that is extraneous to the core issue and fixes an invalid SHA being looked up in one of the tests (which was failing, but for the wrong reason).
* Added some tests for issue #1397Sven Strickroth2013-03-251-0/+15
| | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* Add cl_repo_set_bool and cleanup testsRussell Belfer2013-03-222-18/+6
| | | | | | This adds a helper function for the cases where you want to quickly set a single boolean config value for a repository. This allowed me to remove a lot of code.
* Make iterator APIs consistent with standardsRussell Belfer2013-03-061-0/+3
| | | | | | | | | | | | The iterator APIs are not currently consistent with the parameter ordering of the rest of the codebase. This rearranges the order of parameters, simplifies the naming of a number of functions, and makes somewhat better use of macros internally to clean up the iterator code. This also expands the test coverage of iterator functionality, making sure that case sensitive range-limited iteration works correctly.
* Fix linking error caused by ddcb28a41f3774e26fc6ae0a7174a5565e4749ce.Zhao Cheng2013-01-181-1/+1
|
* Merge pull request #1239 from ethomson/index_removeVicent Martí2013-01-171-4/+4
|\ | | | | add an index_remove_bypath that removes conflicts
| * add an index_remove_bypath that removes conflicts, renamed add_from_workdir ↵Edward Thomson2013-01-121-4/+4
| | | | | | | | to match
* | Minor iterator API cleanupsRussell Belfer2013-01-151-9/+7
| | | | | | | | | | | | | | | | | | In preparation for further iterator changes, this cleans up a few small things in the iterator API: * removed the git_iterator_for_repo_index_range API * made git_iterator_free not be inlined * minor param name and test function name tweaks
* | status: Enhance git_status_file() test coveragenulltoken2013-01-151-0/+89
|/
* Status tests...Vicent Marti2013-01-032-369/+365
|
* Move test cleanup into cleanup functionsBen Straub2013-01-031-5/+11
|
* Tests should clean up after themselvesBen Straub2013-01-031-0/+5
|
* Merge pull request #1115 from ben/struct-versionsVicent Martí2012-12-052-16/+4
|\ | | | | Version info for public structs
| * Deploy GIT_STATUS_OPTIONS_INITBen Straub2012-11-302-16/+4
| |
* | status should ignore conflicts entries in the indexEdward Thomson2012-12-031-0/+76
|/
* Merge pull request #1090 from arrbee/ignore-invalid-by-defaultVicent Martí2012-11-291-0/+38
|\ | | | | Ignore invalid entries by default
| * Set up default internal ignoresRussell Belfer2012-11-191-0/+38
| | | | | | | | | | | | This adds "." ".." and ".git" to the internal ignores list by default - asking about paths with these files will always say that they are ignored.