Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-09-17Add clar helper to create new commit from indexRussell Belfer
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.
2013-09-17Fixing up some win32 issues with autocrlfRussell Belfer
2013-09-17Rearrange clar submodule cleanup codeRussell Belfer
2013-08-28Split rewrites, status doesn't return rewritesEdward Thomson
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".
2013-08-13Merge pull request #1767 from libgit2/win32-bigger-utf8-bufferVicent Martí
Bigger buffer for utf-8 parsing in win32
2013-08-09Improve building ignore file listsRussell Belfer
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.
2013-08-09Merge pull request #1764 from ethomson/status_renames_from_rewritesRussell Belfer
Add rename from rewrites to status
2013-08-09Merge pull request #1462 from yorah/fix/libgit2sharp-issue-379Russell Belfer
status: fix handling of filenames with special prefixes
2013-08-07Add checkout test for long file nameBen Straub
2013-08-07Don't use win32-only macro in test codeBen Straub
2013-08-07Add status test for long pathsBen Straub
2013-08-05Add rename from rewrites to statusEdward Thomson
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.
2013-07-10Untracked directories with .git should be ignoredRussell Belfer
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
2013-07-03Remove GIT_STATUS_SHOW_INDEX_THEN_WORKDIR optionRussell Belfer
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.
2013-07-03Fix segfault in git_status_foreach_ext()yorah
Add tests for the `GIT_STATUS_SHOW_XXX` flags.
2013-06-20Add status flags to force output sort orderRussell Belfer
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.
2013-06-17More tests and bug fixes for status with renameRussell Belfer
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.
2013-06-17Improve case handling in git_diff__paired_foreachRussell Belfer
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.
2013-06-17handle renames in status computationEdward Thomson
2013-06-10Reorganize diff and add basic diff driverRussell Belfer
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.
2013-05-16Fix trailing whitespacesnulltoken
2013-05-10Improve ignore handling in git_status_fileRussell Belfer
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.
2013-04-30Update diff handling of untracked directoriesRussell Belfer
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.
2013-04-21Move some low-level repo fns to include/git2/sysRussell Belfer
2013-04-15status: fix handling of filenames with special prefixesyorah
Fix libgit2/libgit2sharp#379
2013-04-10Tests and more fixes for submodule diffsRussell Belfer
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.
2013-03-30free!Edward Thomson
2013-03-26Fix some diff ignores and submodule dirty workdirRussell Belfer
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.
2013-03-26Implement GIT_STATUS_OPT_EXCLUDE_SUBMODULESRussell Belfer
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).
2013-03-26Recursing into ignored dirs for diff and statusRussell Belfer
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.
2013-03-26Test fixes and cleanupRussell Belfer
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).
2013-03-26Added some tests for issue #1397Sven Strickroth
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2013-03-23Add cl_repo_set_bool and cleanup testsRussell Belfer
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.
2013-03-07Make iterator APIs consistent with standardsRussell Belfer
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.
2013-01-18Fix linking error caused by ddcb28a41f3774e26fc6ae0a7174a5565e4749ce.Zhao Cheng
2013-01-18Merge pull request #1239 from ethomson/index_removeVicent Martí
add an index_remove_bypath that removes conflicts
2013-01-15Minor iterator API cleanupsRussell Belfer
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
2013-01-15status: Enhance git_status_file() test coveragenulltoken
2013-01-12add an index_remove_bypath that removes conflicts, renamed add_from_workdir ↵Edward Thomson
to match
2013-01-03Status tests...Vicent Marti
2013-01-03Move test cleanup into cleanup functionsBen Straub
2013-01-03Tests should clean up after themselvesBen Straub
2012-12-05Merge pull request #1115 from ben/struct-versionsVicent Martí
Version info for public structs
2012-12-04status should ignore conflicts entries in the indexEdward Thomson
2012-12-01Deploy GIT_STATUS_OPTIONS_INITBen Straub
2012-11-29Merge pull request #1090 from arrbee/ignore-invalid-by-defaultVicent Martí
Ignore invalid entries by default
2012-11-28Fix warnings on Win64 buildRussell Belfer
2012-11-28Rename ref and reflog apis for consistencyBen Straub
2012-11-20Set up default internal ignoresRussell Belfer
This adds "." ".." and ".git" to the internal ignores list by default - asking about paths with these files will always say that they are ignored.
2012-11-10Extensions to rmdir and mkdir utilitiesRussell Belfer
* Rework GIT_DIRREMOVAL values to GIT_RMDIR flags, allowing combinations of flags * Add GIT_RMDIR_EMPTY_PARENTS flag to remove parent dirs that are left empty after removal * Add GIT_MKDIR_VERIFY_DIR to give an error if item is a file, not a dir (previously an EEXISTS error was ignored, even for files) and enable this flag for git_futils_mkpath2file call * Improve accuracy of error messages from git_futils_mkdir