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-11-01iconv: Do not fake an API when iconv is not availableVicent Marti
2013-10-08More filemode cleanups for FAT on MacOSRussell Belfer
This cleans up some additional issues. The main change is that on a filesystem that doesn't support mode bits, libgit2 will now create new blobs with GIT_FILEMODE_BLOB always instead of being at the mercy to the filesystem driver to report executable or not. This means that if "core.filemode" lies and claims that filemode is not supported, then we will ignore the executable bit from the filesystem. Previously we would have allowed it. This adds an option to the new git_repository_reset_filesystem to recurse through submodules if desired. There may be other types of APIs that would like a "recurse submodules" option, but this one is particularly useful. This also has a number of cleanups, etc., for related things including trying to give better error messages when problems come up from the filesystem. For example, the FAT filesystem driver on MacOS appears to return errno EINVAL if you attempt to write a filename with invalid UTF-8 in it. We try to capture that with a better error message now.
2013-10-03Wrap iconv stuff and write testsRussell Belfer
This adds a simple wrapper around the iconv APIs and uses it instead of the old code that was inlining the iconv stuff. This makes it possible for me to test the iconv logic in isolation. A "no iconv" version of the API was defined with macros so that I could have fewer ifdefs in the code itself.
2013-10-03Simplify git_path_is_empty_dir implementationRussell Belfer
This simplifies git_path_is_empty_dir on both Windows (getting rid of git_buf allocation inside the function) and other platforms (by just using git_path_direach), and adds tests for the function, and uses the function to simplify some existing tests.
2013-10-03Initial iconv hookup for precomposed unicodeRussell Belfer
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.
2013-10-03Put hooks in place for precompose in dirload fnRussell Belfer
This doesn't actual do string precompose but it puts the hooks in place into the iterators and the git_path_dirload function so that the actual precompose work is ready to go.
2013-09-24Ignore files that disappear while iteratingEdward Thomson
On occasion, files can disappear while we're iterating the filesystem, between calls to readdir and stat. Let's pretend those didn't exist in the first place.
2013-09-17Merge git_buf and git_bufferRussell Belfer
This makes the git_buf struct that was used internally into an externally available structure and eliminates the git_buffer. As part of that, some of the special cases that arose with the externally used git_buffer were blended into the git_buf, such as being careful about git_buf objects that may have a NULL ptr and allowing for bufs with a valid ptr and size but zero asize as a way of referring to externally owned data.
2013-09-11path: Make direach() return EUSER on callback errornulltoken
2013-09-04Fix resolving relative windows network pathsRussell Belfer
2013-09-03path: properly resolve relative pathsNikolai Vladimirov
2013-08-13Merge pull request #1767 from libgit2/win32-bigger-utf8-bufferVicent Martí
Bigger buffer for utf-8 parsing in win32
2013-08-13Minor win32 fixes and improvementsRussell Belfer
This is just a bunch of small fixes that I noticed while looking at the UTF8 and UTF16 path stuff. It fixes a slowdown in looking for an empty directory (not exiting loop asap), makes the dir name in the git__DIR structure be a GIT_FLEX_ARRAY to save an allocation, and fixes some slightly odd assumptions in the cl_getenv helper.
2013-08-13Rename git__win32_path fns to git_win32_pathRussell Belfer
2013-08-13windows: Require orderVicent Marti
2013-08-13windows: Path conversion with better semanticsVicent Marti
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-08Discriminate path-specific and general UTF-X conversionsBen Straub
2013-08-08Rename git_win_str_utf* to git_win32_path_utf*Ben Straub
2013-08-08Add typedefs for win32 utf-8 and utf-16 buffersBen Straub
...and normalize the signatures of the two conversion functions.
2013-08-05Split UTF-16 and UTF-8 buffer sizes for win32Ben Straub
Also fixed up call-sites to use the correct buffer sizes, especially when converting to utf-8.
2013-03-19Three submodule status bug fixesRussell Belfer
1. Fix sort order problem with submodules where "mod" was sorting after "mod-plus" because they were being sorted as "mod/" and "mod-plus/". This involved pushing the "contains a .git entry" test significantly lower in the stack. 2. Reinstate behavior that a directory which contains a .git entry will be treated as a submodule during iteration even if it is not yet added to the .gitmodules. 3. Now that any directory containing .git is reported as submodule, we have to be more careful checking for GIT_EEXISTS when we do a submodule lookup, because that is the error code that is returned by git_submodule_lookup when you try to look up a directory containing .git that has no record in gitmodules or the index.
2013-03-15Improved tree iterator internalsRussell Belfer
This updates the tree iterator internals to be more efficient. The tree_iterator_entry objects are now kept as pointers that are allocated from a git_pool, so that we may use git__tsort_r for sorting (which is better than qsort, given that the tree is likely mostly ordered already). Those tree_iterator_entry objects now keep direct pointers to the data they refer to instead of keeping indirect index values. This simplifies a lot of the data structure traversal code. This also adds bsearch to find the start item position for range- limited tree iterators, and is more explicit about using git_path_cmp instead of reimplementing it. The git_path_cmp changed a bit to make it easier for tree_iterators to use it (but it was barely being used previously, so not a big deal). This adds a git_pool_free_array function that efficiently frees a list of pool allocated pointers (which the tree_iterator keeps). Also, added new tests for the git_pool free list functionality that was not previously being tested (or used).
2013-02-11Fix some incorrect MSVC #ifdef's. Fixes #1305Philip Kelley
2013-01-15Add git_path_icmp to case-insensitive path cmpRussell Belfer
This adds git_path_icmp to complement git_path_cmp.
2013-01-09update copyrightsEdward Thomson
2013-01-04Give proper license notice to code from AndroidMartin Woodward
The usage of the Android derrived code contains a full notice which must be provided with the source code as per the terms given at: https://android.googlesource.com/platform/bionic/+/android-4.0.3_r1.1/libc/bionic/dirname_r.c
2013-01-02path: ifdef GIT_WIN32 looks_like_network_computer_name()Michael Schubert
2012-12-27path: Teach UNC paths to git_path_dirname_r()nulltoken
Fix libgit2/libgit2sharp#256
2012-12-11Fix iterator reset and add reset rangesRussell Belfer
The `git_iterator_reset` command has not been working in all cases particularly when there is a start and end range. This fixes it and adds tests for it, and also extends it with the ability to update the start/end range strings when an iterator is reset.
2012-11-28Consolidate text buffer functionsRussell Belfer
There are many scattered functions that look into the contents of buffers to do various text manipulations (such as escaping or unescaping data, calculating text stats, guessing if content is binary, etc). This groups all those functions together into a new file and converts the code to use that. This has two enhancements to existing functionality. The old text stats function is significantly rewritten and the BOM detection code was extended (although largely we can't deal with anything other than a UTF8 BOM).
2012-11-10Rework checkout with new strategy optionsRussell Belfer
This is a major reworking of checkout strategy options. The checkout code is now sensitive to the contents of the HEAD tree and the new options allow you to update the working tree so that it will match the index content only when it previously matched the contents of the HEAD. This allows you to, for example, to distinguish between removing files that are in the HEAD but not in the index, vs just removing all untracked files. Because of various corner cases that arise, etc., this required some additional capabilities in rmdir and other utility functions. This includes the beginnings of an implementation of code to read a partial tree into the index based on a pathspec, but that is not enabled because of the possibility of creating conflicting index entries.
2012-08-29Add bounds checking to UTF-8 conversionutf8-winVicent Marti
2012-08-23Add template dir and set gid to repo initRussell Belfer
This extends git_repository_init_ext further with support for initializing the repository from an external template directory and with support for the "create shared" type flags that make a set GID repository directory. This also adds tests for much of the new functionality to the existing `repo/init.c` test suite. Also, this adds a bunch of new utility functions including a very general purpose `git_futils_mkdir` (with the ability to make paths and to chmod the paths post-creation) and a file tree copying function `git_futils_cp_r`. Also, this includes some new path functions that were useful to keep the code simple.
2012-07-17Merge branch 'development' into cloneBen Straub
2012-07-12Move is_dot_or_dotdotW into path.h.Ben Straub
2012-07-12Fix compile and workings on msvc.Ben Straub
Signed-off-by: Ben Straub <bstraub@github.com>
2012-07-11Add git_path_is_empty_dir.Ben Straub
2012-07-11Add git_path_is_dot_or_dotdot.Ben Straub
Also, remove some duplication in the clone test suite.
2012-07-11Add path utilities to resolve relative pathsRussell Belfer
This makes it easy to take a buffer containing a path with relative references (i.e. .. or . path segments) and resolve all of those into a clean path. This can be applied to URLs as well as file paths which can be useful. As part of this, I made the drive-letter detection apply on all platforms, not just windows. If you give a path that looks like "c:/..." on any platform, it seems like we might as well detect that as a rooted path. I suppose if you create a directory named "x:" on another platform and want to use that as the beginning of a relative path under the root directory of your repo, this could cause a problem, but then it seems like you're asking for trouble.
2012-07-06Fix libgit2 on GNU/Hurd.Cyril Roelandt
On GNU, the d_name field of the dirent structure is defined as "char d_name[1]", so we must allocate more than sizeof(struct dirent) bytes, just like on Sun.
2012-06-19tree: Proper path comparison logicVicent Marti
2012-06-09Better fix for isalpha in drive letter detectionRussell Belfer
Missed a place that used this and missed git__isalpha
2012-06-09isalpha is not great for UTF-8Russell Belfer
When checking for a drive letter on windows, instead of using isalpha(), it is better to just check for a..z and A..Z, I think, particularly because the MS isalpha implementation appears to assert when given an 0xFF byte.
2012-05-12Fix readdir_r() usage for SolarisScott J. Goldman
On Solaris, struct dirent is defined differently than Linux. The field containing the path name is of size 0, rather than NAME_MAX. So, we need to use a properly sized buffer on Solaris to avoid a stack overflow. Also fix some DIR* leaks on cleanup.
2012-05-08compat: make p_realpath Windows implementation be a bit more POSIX compliant ↵nulltoken
and fail if the provided path does not lead to an existing entry
2012-05-08path: Make git_path_prettify() properly handle ENOTDIR errno valuenulltoken
2012-05-03Merge branch 'new-error-handling' into developmentVicent Martí
Conflicts: .travis.yml include/git2/diff.h src/config_file.c src/diff.c src/diff_output.c src/mwindow.c src/path.c tests-clar/clar_helpers.c tests-clar/object/tree/frompath.c tests/t00-core.c tests/t03-objwrite.c tests/t08-tag.c tests/t10-refs.c tests/t12-repo.c tests/t18-status.c tests/test_helpers.c tests/test_main.c
2012-04-30buf: deploy git_buf_len()nulltoken
2012-04-20GetFileAttributes does not work for utf-8 encoded pathsSven Strickroth
Signed-off-by: Sven Strickroth <email@cs-ware.de>