summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Move crlf conversion into buf_textautocrlf-fixesRussell Belfer2013-03-259-64/+194
| | | | | | | | | | | | | | This adds crlf/lf conversion functions into buf_text with more efficient implementations that bypass the high level buffer functions. They attempt to minimize the number of reallocations done and they directly write the buffer data as needed if they know that there is enough memory allocated to memcpy data. Tests are added for these new functions. The crlf.c code is updated to use the new functions. Removed the include of buf_text.h from filter.h and just include it more narrowly in the places that need it.
* Fix up checkout file contents checksRussell Belfer2013-03-255-59/+80
| | | | | | | | | | | | This fixes of the file contents checks in checkout to give slightly better error messages by directly calling the underlying clar assertions so the file and line number of the top level call can be reported correctly, and renames the helpers to not start with "test_" since that is kind of reserved by clar. This also enables some of the CRLF tests on all platforms that were previously Windows only (by pushing a check of the native line endings into the test body).
* don't convert CRLF to CRCRLFEdward Thomson2013-03-252-5/+54
|
* Test fixes and cleanupRussell Belfer2013-03-256-152/+55
| | | | | | | | 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-2519-0/+335
| | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* Add has_cr_in_index check to CRLF filterRussell Belfer2013-03-252-10/+63
| | | | | | | | | | | | This adds a check to the drop_crlf filter path to check it the file in the index already has a CR in it, in which case this will not drop the CRs from the workdir file contents. This uncovered a "bug" in `git_blob_create_fromworkdir` where the full path to the file was passed to look up the attributes instead of the relative path from the working directory root. This meant that the check in the index for a pre-existing entry of the same name was failing.
* oid: Do not parse OIDs longer than 40Vicent Marti2013-03-252-4/+2
|
* Merge pull request #1428 from xavier-l/nul-terminated-oidVicent Martí2013-03-253-0/+29
|\ | | | | Nul terminated oid
| * Clarified string valueXavier L.2013-03-211-1/+1
| |
| * git_oid_fromstrn already sets a maximum on the length of the stringXavier L2013-03-211-1/+1
| |
| * Added test case for new functionXavier L2013-03-211-0/+14
| |
| * Added an oid function that accepts nul-terminated stringsXavier L2013-03-212-0/+15
| |
* | clar: Disable online tests. By now.Vicent Marti2013-03-252-2/+2
| |
* | Merge pull request #1427 from Lionelon/developmentRussell Belfer2013-03-251-2/+3
|\ \ | | | | | | Fix link issue in network examples
| * | Fix link issue in network exampleslionel vitte2013-03-201-2/+3
| |/
* | Merge pull request #1435 from mcanes/developmentRussell Belfer2013-03-251-1/+1
|\ \ | | | | | | Remove GIT_SUCCESS from documentation
| * | Remove GIT_SUCCESS from documentationMiquel Canes Gonzalez2013-03-241-1/+1
|/ /
* | Merge pull request #1432 from arrbee/update-clarVicent Martí2013-03-2316-141/+145
|\ \ | | | | | | Update clar and some test helpers clean up
| * | Add cl_repo_set_bool and cleanup testsRussell Belfer2013-03-2212-111/+45
| | | | | | | | | | | | | | | | | | 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.
| * | Update cl_assert_equal_sz to be nicerRussell Belfer2013-03-222-7/+7
| | | | | | | | | | | | | | | | | | | | | This makes the size_t comparison test nicer (assuming that the values are actually not using the full length), and converts some cases that were using it for pointer comparison to use the macro that is designed for pointer comparison.
| * | Update to latest ClarRussell Belfer2013-03-223-23/+93
| |/
* | graph: make the ahead-behind docs clearerCarlos Martín Nieto2013-03-222-13/+18
|/ | | | | Explain it in local-upstream branch terms so it's easier to grasp than with the `one` and `two` naming from the merge-base code.
* Merge pull request #1423 from arrbee/submodule-status-errorsVicent Martí2013-03-1924-27/+130
|\ | | | | Three submodule status bug fixes
| * Three submodule status bug fixesRussell Belfer2013-03-1824-27/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | clone: fix param commentCarlos Martín Nieto2013-03-191-1/+1
|/
* Merge pull request #1417 from arrbee/opts-for-pathsVicent Martí2013-03-1821-245/+677
|\ | | | | Implement opts interface for global/system file search paths
| * Fixes and cleanupsRussell Belfer2013-03-186-158/+75
| | | | | | | | | | Get rid of some dead code, tighten things up a bit, and fix a bug with core::env test.
| * Switch search paths to classic delimited stringsRussell Belfer2013-03-1810-157/+241
| | | | | | | | | | | | | | | | | | | | | | | | This switches the APIs for setting and getting the global/system search paths from using git_strarray to using a simple string with GIT_PATH_LIST_SEPARATOR delimited paths, just as the environment PATH variable would contain. This makes it simpler to get and set the value. I also added code to expand "$PATH" when setting a new value to embed the old value of the path. This means that I no longer require separate actions to PREPEND to the value.
| * Implement global/system file search pathsRussell Belfer2013-03-1519-241/+672
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The goal of this work is to expose the search logic for "global", "system", and "xdg" files through the git_libgit2_opts() interface. Behind the scenes, I changed the logic for finding files to have a notion of a git_strarray that represents a search path and to store a separate search path for each of the three tiers of config file. For each tier, I implemented a function to initialize it to default values (generally based on environment variables), and then general interfaces to get it, set it, reset it, and prepend new directories to it. Next, I exposed these interfaces through the git_libgit2_opts interface, reusing the GIT_CONFIG_LEVEL_SYSTEM, etc., constants for the user to control which search path they were modifying. There are alternative designs for the opts interface / argument ordering, so I'm putting this phase out for discussion. Additionally, I ended up doing a little bit of clean up regarding attr.h and attr_file.h, adding a new attrcache.h so the other two files wouldn't have to be included in so many places.
* | Merge pull request #1420 from KindDragon/static-code-analyzer-warningsVicent Martí2013-03-1821-48/+62
|\ \ | | | | | | Several warnings detected by static code analyzer fixed
| * | Several warnings detected by static code analyzer fixedArkadiy Shapkin2013-03-1821-48/+62
| |/ | | | | | | | | | | | | Implicit type conversion argument of function to size_t type Suspicious sequence of types castings: size_t -> int -> size_t Consider reviewing the expression of the 'A = B == C' kind. The expression is calculated as following: 'A = (B == C)' Unsigned type is never < 0
* | Merge pull request #1080 from carlosmn/config-set-nullVicent Martí2013-03-183-2/+21
|\ \ | | | | | | Failing config related test
| * | config: don't allow passing NULL as a value to setCarlos Martín Nieto2013-03-093-2/+21
| | | | | | | | | | | | | | | | | | Passing NULL is non-sensical. The error message leaves to be desired, though, as it leaks internal implementation details. Catch it at the `git_config_set_string` level and set an appropriate error message.
* | | Merge pull request #1418 from QbProg/qb/cmake-msvcVicent Martí2013-03-181-4/+24
|\ \ \ | |_|/ |/| | MSVC cmake improvements
| * | Fix for a cmake bug when using MSVC + Win64 + static librariesQbProg2013-03-171-0/+6
| | | | | | | | | | | | (see http://public.kitware.com/Bug/view.php?id=11240)
| * | Adds an option to select the CRT link mode ( static or dynamic ).QbProg2013-03-171-4/+18
|/ / | | | | | | This is useful when linking libgit2 statically, as the setting must match the linking program's one.
* | odb_pack: Unused functionsVicent Marti2013-03-151-20/+0
| |
* | pool: Internal struct nameVicent Marti2013-03-151-6/+5
| |
* | Merge pull request #1413 from arrbee/more-iterator-refactorVicent Martí2013-03-1511-262/+297
|\ \ | | | | | | Further tree_iterator refactoring
| * | Added pool freelist struct for readabilityRussell Belfer2013-03-141-7/+15
| | | | | | | | | | | | | | | | | | This adds a git_pool_freelist_item struct that makes it a little easier to follow what's going on with the pool free list block management code. It is functionally neutral.
| * | Fix valgrind issues (and mmap fallback for diff)Russell Belfer2013-03-144-21/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a number of issues identified by valgrind - mostly missed free calls. Inside valgrind, mmap() may fail which causes some of the diff tests to fail. This adds a fallback code path to diff_output.c:get_workdir_content() where is the mmap() fails the code will now try to read the file data directly into allocated memory (which is what it would do if the data needed to be filtered anyhow).
| * | Improved tree iterator internalsRussell Belfer2013-03-147-240/+251
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* | | Merge pull request #1414 from arrbee/more-build-warning-fixesVicent Martí2013-03-145-25/+27
|\ \ \ | |/ / |/| | Fix various build warnings
| * | Fix various build warningsRussell Belfer2013-03-145-25/+27
|/ / | | | | | | This fixes various build warnings on Mac and Windows (64-bit).
* | Merge pull request #1411 from arrbee/workdir-iterator-depth-limit-bugVicent Martí2013-03-132-10/+75
|\ \ | | | | | | Fix workdir iterator bugs
| * | Fix workdir iterator bugsRussell Belfer2013-03-132-10/+75
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes two bugs with the workdir iterator depth check: first that the depth was not being decremented and second that empty directories were counting against the depth even though a frame was not being created for them. This also fixes a bug with the ENOTFOUND return code for workdir iterators when you attempt to advance_into an empty directory. Actually, that works correctly, but it was incorrectly being propogated into regular advance() calls in some circumstances. Added new tests for the above that create a huge hierarchy on the fly and try using the workdir iterator to traverse it.
* | MSVC: What could possibly be the size of a void*?Vicent Marti2013-03-121-1/+2
| |
* | Merge pull request #1410 from phkelley/push_sidebandVicent Martí2013-03-123-36/+120
|\ \ | | | | | | Advertise and support side-band-64k when calling receive-pack
| * | Style: Reverse lhs and rhs of == comparisonsPhilip Kelley2013-03-121-2/+2
| | |
| * | Advertise and support side-band-64k when calling receive-packPhilip Kelley2013-03-123-36/+120
|/ /