summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2366 from kitbellew/fix-indexer-mmap-castdevelopmentCarlos Martín Nieto2014-10-278-24/+29
|\ | | | | Fix compiler warning (git_off_t cast to size_t).
| * Fix compiler warning (git_off_t cast to size_t).Albert Meltzer2014-05-198-24/+29
| | | | | | | | | | | | Use size_t for page size, instead of long. Check result of sysconf. Use size_t for page offset so no cast to size_t (second arg to p_mmap). Use mod instead div/mult pair, so no cast to size_t is necessary.
* | Merge pull request #2422 from libgit2/cmn/ssh-retryVicent Marti2014-08-264-35/+215
|\ \ | | | | | | Enable retries for SSH
| * | ssh: make sure to ask for a username and use the same oneCarlos Martín Nieto2014-06-262-34/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to know which authentication methods are supported/allowed by the ssh server, we need to send a NONE auth request, which needs a username associated with it. Most ssh server implementations do not allow switching the username between authentication attempts, which means we cannot use a dummy username and then switch. There are two ways around this. The first is to use a different connection, which an earlier commit implements, but this increases how long it takes to get set up, and without knowing the right username, we cannot guarantee that the list we get in response is the right one. The second is what's implemented here: if there is no username specified in the url, ask for it first. We can then ask for the list of auth methods and use the user's credentials in the same connection.
| * | cred: add convenience function to get the usernameCarlos Martín Nieto2014-06-262-0/+49
| | | | | | | | | | | | | | | Since each cred defines the username on their own, introduce git_cred__username to retrieve the username pointer from them.
| * | cred: introduce username-only credCarlos Martín Nieto2014-06-261-0/+23
| | | | | | | | | | | | | | | This exists as ssh needs to know about the username to use before it can query for the supported authentication methods.
| * | ssh: request credentials again on authentication failureCarlos Martín Nieto2014-06-261-26/+60
| | | | | | | | | | | | | | | Instead of completely giving up on the first failure, ask for credentials as long as we fail to authenticate.
| * | ssh: propagate the error code from the auth callbackCarlos Martín Nieto2014-06-171-13/+12
| | | | | | | | | | | | We need to be able to get a GIT_EUSER back through the outermost call.
| * | ssh: detect authentication methodsCarlos Martín Nieto2014-06-171-6/+77
| | | | | | | | | | | | | | | | | | | | | | | | Before calling the credentials callback, ask the sever which authentication methods it supports and report that to the user, instead of simply reporting everything that the transport supports. In case of an error, we do fall back to listing all of them.
* | | Merge pull request #2421 from libgit2/cmn/init-ssl-onceVicent Marti2014-06-144-16/+81
|\ \ \ | | | | | | | | netops: init OpenSSL once under lock
| * | | ssl: init everything all the timecmn/init-ssl-onceCarlos Martín Nieto2014-06-123-87/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bring together all of the OpenSSL initialization to git_threads_init() so it's together and doesn't need locks. Moving it here also gives us libssh2 thread safety (when built against openssl).
| * | | ssl: init also without threadsCarlos Martín Nieto2014-06-121-9/+10
| | | |
| * | | ssl: cargo-cult thread safetyCarlos Martín Nieto2014-06-124-23/+46
| | | | | | | | | | | | | | | | OpenSSL's tests init everything in the main thread, so let's do that.
| * | | ssl: use lockingCarlos Martín Nieto2014-06-111-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using in a multithreaded context, OpenSSL needs to lock, and leaves it up to application to provide said locks. We were not doing this, and it's just luck that's kept us from crashing up to now.
| * | | netops: init OpenSSL once under lockCarlos Martín Nieto2014-06-113-2/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OpenSSL init functions are not reentrant, which means that running multiple fetches in parallel can cause us to crash. Use a mutex to init OpenSSL, and since we're adding this extra checks, init it only once.
* | | | http: fix typo in credentials logicCarlos Martín Nieto2014-06-131-1/+1
| |/ / |/| | | | | | | | | | | We want to check whether the credentials callback is NULL, not whether the payload is.
* | | revwalk: more sensible array handlingcmn/revwalk-array-fixCarlos Martín Nieto2014-06-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using a sentinel empty value to detect the last commit, let's check for when we get a NULL from popping the stack, which lets us know when we're done. The current code causes us to read uninitialized data, although only on RHEL/CentOS 6 in release mode. This is a readability win overall.
* | | treebuilder: insert sortedcmn/treebuilder-insert-sortedCarlos Martín Nieto2014-06-101-2/+2
| | | | | | | | | | | | | | | By inserting in the right position, we can keep the vector sorted, making entry insertion almost twice as fast.
* | | Merge pull request #2407 from libgit2/cmn/remote-rename-morev0.21.0-rc1Vicent Marti2014-06-081-71/+80
|\ \ \ | | | | | | | | More remote rename fixes
| * | | remote: don't free the remote on deletecmn/remote-rename-moreCarlos Martín Nieto2014-06-061-2/+0
| | | | | | | | | | | | | | | | This was a bad idea. Don't free except in the free function.
| * | | remote: handle symrefs when renamingCarlos Martín Nieto2014-06-061-10/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A symref inside the namespace gets renamed, we should make it point to the target's new name. This is for the origin/HEAD -> origin/master type of situations.
| * | | remote: return problem refspecs instead of using a callbackCarlos Martín Nieto2014-06-061-15/+25
| | | | | | | | | | | | | | | | | | | | | | | | There is no reason why we need to use a callback here. A string array fits better with the usage, as this is not an event and we don't need anything from the user.
| * | | remote: make sure the name stays valid on renameCarlos Martín Nieto2014-06-061-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | We must make sure that the name pointer remains valid, so make sure to allocate the new one before freeing the old one and swap them so the user never sees an invalid pointer.
| * | | remote: remove rename code for anonymous remotesCarlos Martín Nieto2014-06-061-42/+11
| |/ / | | | | | | | | | | | | | | | | | | | | | We don't allow renames of anonymous remotes, so there's no need to handle them. A remote is always associated with a repository, so there's no need to check for that.
* | | React to review feedbackPhilip Kelley2014-06-073-18/+26
| | |
* | | Win32: Fix object::cache::threadmania test on x64Philip Kelley2014-06-075-63/+91
|/ /
* | remote: tighten up reference renamingcmn/remote-rename-fixesCarlos Martín Nieto2014-06-061-7/+9
| | | | | | | | | | | | | | | | Tighten up which references we consider for renaming so we don't try to rename unrelated ones and end up with unexplained references. If there is a reference on the target namespace, git overwrites it, so let's do the same.
* | Merge pull request #2399 from libgit2/cmn/path-to-pathVicent Marti2014-06-034-35/+26
|\ \ | | | | | | clone: re-use the local transport's path resolution
| * | clone: re-use the local transport's path resolutioncmn/path-to-pathCarlos Martín Nieto2014-06-034-35/+26
| | | | | | | | | | | | | | | | | | Whe already worked out the kinks with the function used in the local transport. Expose it and make use of it in the local clone method instead of trying to work it out again.
* | | Merge pull request #2395 from libgit2/cmn/ref-iter-concurrentRussell Belfer2014-06-031-8/+16
|\ \ \ | |/ / |/| | Concurrent ref iterator access
| * | refs: copy the packed refs on iterationcmn/ref-iter-concurrentCarlos Martín Nieto2014-06-021-8/+16
| | | | | | | | | | | | | | | This lets us work without worrying about what's happening but work on a snapshot.
* | | Merge pull request #2389 from ↵Vicent Marti2014-06-031-0/+1
|\ \ \ | |/ / |/| | | | | | | | arthurschreiber/arthur/set-error-when-no-remote-found Remote: Set an error when a remote cannot be found.
| * | Remote: Set an error when a remote cannot be found.Arthur Schreiber2014-05-301-0/+1
| | | | | | | | | | | | | | | | | | | | | Inside `git_remote_load`, the calls to `get_optional_config` use `giterr_clear` to unset any errors that are set due to missing config keys. If neither a fetch nor a push url config was found for a remote, we should set an error again.
* | | remote: build up the list of refs to removecmn/remote-deleteCarlos Martín Nieto2014-06-011-8/+34
| | | | | | | | | | | | | | | | | | When removing the remote-tracking branches, build up the list and remove in two steps, working around an issue with the iterator. Removing while we're iterating over the refs can cause us to miss references.
* | | minor cleanupsRussell Belfer2014-05-311-5/+5
| | |
* | | Clean up the handling of large binary diffsRussell Belfer2014-05-312-38/+55
| | |
* | | Ignore core.safecrlf=warn until we have a warn infrastructureEdward Thomson2014-05-301-1/+7
|/ /
* | Refs: Introduce `git_refname_t`.Arthur Schreiber2014-05-302-13/+12
| |
* | Refs: Fix some issue when core.precomposeunicode = true.Arthur Schreiber2014-05-302-25/+9
| | | | | | | | | | | | | | | | | | | | | | This fixes two issues I found when core.precomposeunicode is enabled: * When creating a reference with a NFD string, the returned git_reference would return this NFD string as the reference’s name. But when looking up the reference later, the name would then be returned as NFC string. * Renaming a reference would not honor the core.precomposeunicode and apply no normalization to the new reference name.
* | config: initialize the errorCarlos Martín Nieto2014-05-301-1/+1
| | | | | | | | | | The error would be uninitialized if we take a snapshot of a config with no backends.
* | Merge pull request #2011 from libgit2/cmn/clone-localVicent Marti2014-05-294-13/+179
|\ \ | | | | | | Local clone
| * | clone: allow for linking in local cloneCarlos Martín Nieto2014-05-281-5/+31
| | | | | | | | | | | | | | | | | | | | | | | | If requested, git_clone_local_into() will try to link the object files instead of copying them. This only works on non-Windows (since it doesn't have this) when both are on the same filesystem (which are unix semantics).
| * | fileops: allow linking files when copying directory structuresCarlos Martín Nieto2014-05-282-2/+6
| | | | | | | | | | | | | | | When passed the LINK_FILES flag, the recursive copy will hardlink files instead of copying them.
| * | clone: add flag not to linkCarlos Martín Nieto2014-05-281-1/+1
| | |
| * | clone: add flags to override whether to perform a local cloneCarlos Martín Nieto2014-05-282-1/+36
| | |
| * | clone: store the realpath when given a relative oneCarlos Martín Nieto2014-05-281-1/+10
| | | | | | | | | | | | | | | | | | | | | A call like git_clone("./foo", "./foo1") writes origin's url as './foo', which makes it unusable, as they're relative to different things. Go with git's behaviour and store the realpath as the url.
| * | clone: perform a "local clone" when given a local pathCarlos Martín Nieto2014-05-281-11/+103
| | | | | | | | | | | | | | | | | | | | | | | | When git is given such a path, it will perform a "local clone", bypassing the git-aware protocol and simply copying over all objects that exist in the source. Copy this behaviour when given a local path.
* | | Merge pull request #2380 from libgit2/cmn/index-add-modesVicent Marti2014-05-281-0/+14
|\ \ \ | | | | | | | | index: check for valid filemodes on add
| * | | index: check for valid filemodes on addcmn/index-add-modesCarlos Martín Nieto2014-05-221-0/+14
| | | |
* | | | Merge pull request #2359 from e45lee/chmod-fixVicent Marti2014-05-281-6/+14
|\ \ \ \ | | | | | | | | | | Fixed permissions on template directories.