summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* submodule: set a default to the iteratorethomson/fixesEdward Thomson2017-01-251-1/+2
| | | | The iterator is always freed, but not always initialized first.
* Merge pull request #4086 from libgit2/ethomson/fixesCarlos Martín Nieto2017-01-243-14/+15
|\ | | | | WIP: some coverity & compiler warning fixes
| * attr_cache_remove: don't remove given fileEdward Thomson2017-01-231-4/+6
| | | | | | | | | | If `attr_cache_lookup_entry` fails to find the given file, make sure that we do not try to free the given file.
| * mac: on 32 bit, use `__builtin_umull_overflow`Edward Thomson2017-01-231-6/+6
| |
| * submodule: only examine idx & head given a configEdward Thomson2017-01-231-2/+2
| |
| * submodule: don't double free during load failureEdward Thomson2017-01-231-2/+1
| | | | | | | | | | When we fail to load submodules, don't free the list; it is later freed unconditionally.
* | Merge pull request #4050 from ethomson/ethomson/winhttp_errmsgsCarlos Martín Nieto2017-01-241-7/+47
|\ \ | |/ |/| WinHTTP: set proper error messages when SSL fails
| * winhttp: set proper cert failure error messagesEdward Thomson2017-01-211-7/+47
| | | | | | | | | | | | Set up a WinHTTP status callback; inspect the WinHTTP status for WINHTTP_CALLBACK_STATUS_SECURE_FAILURE, and convert the status code to a useful message for callers.
* | variable 'i' is used uninitialized whenever 'if' condition is trueEtienne Samson2017-01-231-1/+2
| |
* | Merge pull request #4051 from tiennou/clang-analyzer-1Edward Thomson2017-01-213-5/+7
|\ \ | | | | | | Clang analyzer run
| * | pack: report revwalk errorEtienne Samson2017-01-131-1/+1
| | |
| * | patch: memory leak of patch.base.diff_opts.new|old_prefixEtienne Samson2017-01-131-1/+3
| | |
| * | ignore: there must be a repositoryEtienne Samson2017-01-131-3/+3
| | | | | | | | | Otherwise we'll NULL-dereference in git_attr_cache__init
* | | Merge pull request #4053 from chescock/extend-packfile-by-pagesEdward Thomson2017-01-211-1/+24
|\ \ \ | | | | | | | | Extend packfile in increments of page_size.
| * | | Extend packfile in increments of page_size.Chris Hescock2016-12-291-1/+24
| | | | | | | | | | | | | | | | This improves performance by reducing the number of I/O operations.
* | | | Merge branch 'pr/3912'Edward Thomson2017-01-213-6/+31
|\ \ \ \ | |_|_|/ |/| | |
| * | | symbolic ref target validation: fixupsEdward Thomson2017-01-213-31/+11
| | | | | | | | | | | | | | | | Fixups requested in #3912.
| * | | Make symbolic ref target validation optionalRichard Ipsum2016-08-273-4/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce GIT_OPT_ENABLE_SYMBOLIC_REF_TARGET_VALIDATION option. Setting this option to 0 allows validation of a symbolic ref's target to be bypassed. This option is enabled by default. This mechanism is added primarily to address a discrepancy between git behaviour and libgit2 behaviour, whereby the former allows the symbolic ref target to carry an arbitrary string and the latter does not, so: $ git symbolic-ref refs/heads/foo bar $ cat .git/refs/heads/foo ref: bar where as attempting the same via libgit2 raises an error: The given reference name 'bar' is not valid this mechanism also allows those that might want to make use of git's more lenient treatment of symbolic ref targets to do so.
* | | | Merge pull request #3892 from mitesch/shared_bufferEdward Thomson2017-01-211-15/+30
|\ \ \ \ | | | | | | | | | | Use a shared buffer in calls of git_treebuilder_write to avoid heap contention
| * | | | write_tree: use shared buffer for writing treesMichael Tesch2016-12-121-15/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function to write trees allocates a new buffer for each tree. This causes problems with performance when performing a lot of actions involving writing trees, e.g. when doing many merges. Fix the issue by instead handing in a shared buffer, which is then re-used across the calls without having to re-allocate between calls.
* | | | | Merge branch 'master' into pr/3938Edward Thomson2017-01-21109-846/+1208
|\ \ \ \ \
| * | | | | indexer: avoid warning about `idx->pack`ethomson/packfile_closeEdward Thomson2017-01-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | It must be non-NULL to have a valid `git_indexer`.
| * | | | | indexer: introduce `git_packfile_close`Edward Thomson2017-01-213-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | Encapsulation!
| * | | | | Merge pull request #4016 from novalis/submodule-optimizationEdward Thomson2017-01-214-94/+181
| |\ \ \ \ \ | | | | | | | | | | | | | | Submodule optimization
| | * | | | | Skip submodule head/index update when caching.Brock Peabody2017-01-201-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `git_submodule_status` is very slow, bottlenecked on `git_repository_head_tree`, which it uses through `submodule_update_head`. If the user has requested submodule caching, assume that they want this status cached too and skip it. Signed-off-by: David Turner <dturner@twosigma.com>
| | * | | | | Allow for caching of submodules.Brock Peabody2017-01-204-39/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added `git_repository_submodule_cache_all` to initialze a cache of submodules on the repository so that operations looking up N submodules are O(N) and not O(N^2). Added a `git_repository_submodule_cache_clear` function to remove the cache. Also optimized the function that loads all submodules as it was itself O(N^2) w.r.t the number of submodules, having to loop through the `.gitmodules` file once per submodule. I changed it to process the `.gitmodules` file once, into a map. Signed-off-by: David Turner <dturner@twosigma.com>
| | * | | | | Fix formattingDavid Turner2017-01-201-71/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: David Turner <dturner@twosigma.com>
| * | | | | | Merge branch 'pr/4060'Edward Thomson2017-01-211-1/+18
| |\ \ \ \ \ \ | | |/ / / / / | |/| | | | |
| | * | | | | indexer: only delete temp file if it was unusedEdward Thomson2017-01-211-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only try to `unlink` our temp file when we know that we didn't copy it into its permanent location.
| | * | | | | Addressed review feedbacklhchavez2017-01-141-5/+5
| | | | | | |
| | * | | | | Close the file before unlinkinglhchavez2017-01-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I forgot that Windows chokes while trying to delete open files.
| | * | | | | Delete temporary packfile in indexerlhchavez2017-01-011-0/+9
| | | |_|/ / | | |/| | | | | | | | | | | | | | | | | | | | | This change deletes the temporary packfile that the indexer creates to avoid littering the pack/ directory with garbage.
| * | | | | WinHTTP: support best auth mechanismEdward Thomson2017-01-161-63/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For username/password credentials, support NTLM or Basic (in that order of priority). Use the WinHTTP built-in authentication support for both, and maintain a bitfield of the supported mechanisms from the response.
| * | | | | Merge pull request #4054 from ↵Edward Thomson2017-01-141-0/+4
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | jfultz/jfultz/fix_GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH Fix handling of GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH flag.
| | * | | | | Fix handling of GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH flag.John Fultz2016-12-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git_checkout_tree() sets up its working directory iterator to respect the pathlist if GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH is present, which is great. What's not so great is that this iterator is then used side-by-side with an iterator created by git_checkout_iterator(), which did not set up its pathlist appropriately (although the iterator mirrors all other iterator options). This could cause git_checkout_tree() to delete working tree files which were not specified in the pathlist when GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH was used, as the unsynchronized iterators causes git_checkout_tree() to think that files have been deleted between the two trees. Oops. And added a test which fails without this fix (specifically, the final check for "testrepo/README" to still be present fails).
| * | | | | | Merge pull request #4061 from libgit2/ethomson/merge_optsCarlos Martín Nieto2017-01-141-4/+4
| |\ \ \ \ \ \ | | |_|_|_|_|/ | |/| | | | | merge: set default rename threshold
| | * | | | | merge: set default rename thresholdEdward Thomson2017-01-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `GIT_MERGE_FIND_RENAMES` is set, provide a default for `rename_threshold` when it is unset.
| * | | | | | Merge pull request #4049 from libgit2/ethomson/error_msgsCarlos Martín Nieto2017-01-1394-496/+496
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | giterr_set: consistent error messages
| | * | | | | | giterr_set: consistent error messagesEdward Thomson2016-12-2994-496/+496
| | | |/ / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Error messages should be sentence fragments, and therefore: 1. Should not begin with a capital letter, 2. Should not conclude with punctuation, and 3. Should not end a sentence and begin a new one
| * | | | | | Merge remote-tracking branch 'upstream/maint/v0.25'Carlos Martín Nieto2017-01-093-18/+14
| |\ \ \ \ \ \ | | |_|/ / / / | |/| | | | |
| | * | | | | Merge branch '25_smartpktparse' into maint/v0.25Edward Thomson2017-01-062-16/+13
| | |\ \ \ \ \
| | | * | | | | smart_pkt: treat empty packet lines as errorPatrick Steinhardt2017-01-062-16/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Git protocol does not specify what should happen in the case of an empty packet line (that is a packet line "0004"). We currently indicate success, but do not return a packet in the case where we hit an empty line. The smart protocol was not prepared to handle such packets in all cases, though, resulting in a `NULL` pointer dereference. Fix the issue by returning an error instead. As such kind of packets is not even specified by upstream, this is the right thing to do.
| | | * | | | | smart_pkt: verify packet length exceeds PKT_LEN_SIZEPatrick Steinhardt2017-01-061-0/+8
| | | | |/ / / | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each packet line in the Git protocol is prefixed by a four-byte length of how much data will follow, which we parse in `git_pkt_parse_line`. The transmitted length can either be equal to zero in case of a flush packet or has to be at least of length four, as it also includes the encoded length itself. Not checking this may result in a buffer overflow as we directly pass the length to functions which accept a `size_t` length as parameter. Fix the issue by verifying that non-flush packets have at least a length of `PKT_LEN_SIZE`.
| | * | | | | http: check certificate validity before clobbering the error variableEtienne Samson2017-01-061-2/+1
| | |/ / / /
| * | | | | Merge pull request #4043 from fudanchii/fudanchii/openbsdEdward Thomson2016-12-301-1/+1
| |\ \ \ \ \ | | |_|/ / / | |/| | | | Fix BIO_* functions method linking when compiled with libressl (OpenBSD).
| | * | | | Fix BIO_* functions method linking when compiled with libressl.Nurahmadie2016-12-241-1/+1
| | |/ / / | | | | | | | | | | | | | | | | | | | | ref: https://github.com/gentoo/libressl/blob/672ac74ce7b7cb2e4799b2d66bc0b1b1efa3454e/media-video/ffmpeg/files/ffmpeg-3.2-libressl.patch
| * | | | rebase: check the result code of rebase_init_mergeJacques Germishuys2016-12-291-1/+1
| | | | |
| * | | | mempack: set the odb backend versionJacques Germishuys2016-12-251-0/+1
| |/ / /
| * | | http: bump the pretend git version in the User-Agentcmn/bump-pretend-gitCarlos Martín Nieto2016-12-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to keep the git UA in order for services to recognise that we're a Git client and not a browser. But in order to stop dumb HTTP some services have blocked UAs that claim to be pre-1.6.6 git. Thread these needles by using the "git/2.0" prefix which is still close enough to git's yet distinct enough that you can tell it's us.
| * | | Merge pull request #4034 from libgit2/cmn/sysdir-no-reguessEdward Thomson2016-12-201-1/+1
| |\ \ \ | | | | | | | | | | sysdir: don't re-guess when using variable substitution