summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | | | Silence uninitialized warningJacques Germishuys2014-09-261-1/+1
| | | | | | | | | |
| * | | | | | | | | The raw index buffer content is not guaranteed to be alignedJacques Germishuys2014-09-261-24/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Ensure alignment by copying the content into a structure on the stack
| * | | | | | | | | Ensure pool data is aligned on an 8 byte boundaryJacques Germishuys2014-09-251-1/+1
| | | | | | | | | |
| * | | | | | | | | Introduce GIT_ALIGNJacques Germishuys2014-09-251-0/+8
| |/ / / / / / / /
* | | | | | | | | Merge pull request #2582 from swansontec/masterEdward Thomson2014-09-291-1/+1
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Correctly handle getaddrinfo return result
| * | | | | | | | | Correctly handle getaddrinfo return resultWilliam Swanson2014-09-241-1/+1
| |/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The getaddrinfo function indicates failure with a non-zero return code, but this code is not necessarily negative. On platforms like Android where the code is positive, a failed call causes libgit2 to segfault.
* | | | | | | | | Merge pull request #2559 from libgit2/cmn/free-tls-errorEdward Thomson2014-09-291-0/+3
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | | global: free the error message when exiting a thread
| * | | | | | | | global: free the error message when exiting a threadcmn/free-tls-errorCarlos Martín Nieto2014-09-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we free the global state at thread termination, we must also free the error message in order not to leak the string once per thread.
* | | | | | | | | Merge pull request #2567 from cirosantilli/factor-41Vicent Marti2014-09-173-5/+6
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Factor 40 and 41 constants from source.
| * | | | | | | | | Factor 40 and 41 constants from source.Ciro Santilli2014-09-163-5/+6
| | |_|_|_|_|_|/ / | |/| | | | | | |
* | | | | | | | | Merge pull request #2571 from libgit2/vmg/walk-up-pathVicent Marti2014-09-176-24/+41
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Fix `git_path_walk_up` to work with non-rooted paths
| * | | | | | | | | repository: Do not double-free configvmg/walk-up-pathThe rugged tests are fragile2014-09-171-8/+8
| | | | | | | | | |
| * | | | | | | | | StyleThe rugged tests are fragile2014-09-171-3/+2
| | | | | | | | | |
| * | | | | | | | | attr: Do not walk path if we're at the rootThe rugged tests are fragile2014-09-171-5/+8
| | | | | | | | | |
| * | | | | | | | | path: Fix `git_path_walk_up` to work with non-rooted pathsThe rugged tests are fragile2014-09-175-11/+26
| | | | | | | | | |
* | | | | | | | | | Merge pull request #2572 from cirosantilli/factor-voidVicent Marti2014-09-171-2/+2
|\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | | Replace void casts with GIT_UNUSED.
| * | | | | | | | | Replace void casts with GIT_UNUSED.Ciro Santilli2014-09-171-2/+2
| |/ / / / / / / /
* | | | | | | | | Merge pull request #2464 from libgit2/cmn/host-cert-infoVicent Marti2014-09-179-77/+225
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Provide a callback for certificate validation
| * | | | | | | | | winhttp: get rid of the cert ignore flagCarlos Martín Nieto2014-09-161-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This brings us back in line with the other transports.
| * | | | | | | | | ssh: expose both hashesCarlos Martín Nieto2014-09-161-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The user may have the data hashed as MD5 or SHA-1, so we should provide both types for consumption.
| * | | | | | | | | ssh: provide our own types for host key lengthsCarlos Martín Nieto2014-09-161-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using the libssh2 defines, provide our own, which eases usage as we do not need to check whether libgit2 was built with libssh2 or not.
| * | | | | | | | | net: use only structs to pass information about certCarlos Martín Nieto2014-09-163-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of spreading the data in function arguments, some of which aren't used for ssh and having a struct only for ssh, use a struct for both, using a common parent to pass to the callback.
| * | | | | | | | | Merge remote-tracking branch 'upstream/master' into cmn/host-cert-infoCarlos Martín Nieto2014-09-1617-128/+322
| |\ \ \ \ \ \ \ \ \
| * | | | | | | | | | net: remove support for outright ignoring certificatesCarlos Martín Nieto2014-09-165-30/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This option make it easy to ignore anything about the server we're connecting to, which is bad security practice. This was necessary as we didn't use to expose detailed information about the certificate, but now that we do, we should get rid of this. If the user wants to ignore everything, they can still provide a callback which ignores all the information passed.
| * | | | | | | | | | winhttp: set ignore security flags on user commandCarlos Martín Nieto2014-09-161-6/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the user returns 0 from the certificate check and we had certificate issues, set the options to ignore certificate errors and resend the request.
| * | | | | | | | | | winhttp: bring together request sendingCarlos Martín Nieto2014-09-161-32/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to call WinHttpSendRequest() in three different places. Unify all in a single function to have a single place for the certificate check.
| * | | | | | | | | | winhttp: only do certificate check for SSLCarlos Martín Nieto2014-09-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we're not using SSL, don't call the user's certificate check callback.
| * | | | | | | | | | winhttp: credential check on successful connectCarlos Martín Nieto2014-09-161-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On successful connection, still ask the user whether they accept the server's certificate, indicating that WinHTTP would let it though.
| * | | | | | | | | | Bring certificate check back to the normal return codeCarlos Martín Nieto2014-09-162-20/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Returning 0 lets the certificate check succeed. An error code is bubbled up to the user.
| * | | | | | | | | | ssh: do ssh cert info before asking for credentialsCarlos Martín Nieto2014-09-161-47/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We know the host's key as soon as we connect, so we should perform the check as soon as we can, before we bother with the user's credentials.
| * | | | | | | | | | transport: always call the certificate check callbackCarlos Martín Nieto2014-09-162-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should let the user decide whether to cancel the connection or not regardless of whether our checks have decided that the certificate is fine. We provide our own assessment to the callback to let the user fall back to our checks if they so desire.
| * | | | | | | | | | http: send the DER-encoded cert to the callbackCarlos Martín Nieto2014-09-162-22/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of the parsed data, we can ask OpenSSL to give us the DER-encoded version of the certificate, which the user can then parse and validate.
| * | | | | | | | | | Provide a callback for certificate validationCarlos Martín Nieto2014-09-166-7/+68
| | |_|_|_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the certificate validation fails (or always in the case of ssh), let the user decide whether to allow the connection. The data structure passed to the user is the native certificate information from the underlying implementation, namely OpenSSL or WinHTTP.
* | | | | | | | | | Clean up some leaks in the test suiteCarlos Martín Nieto2014-09-171-1/+3
| | | | | | | | | |
* | | | | | | | | | Merge pull request #2561 from jacquesg/merge-skipVicent Marti2014-09-161-3/+11
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | No files merged may result in bogus merge conflict error
| * | | | | | | | | | Remove local unused index_repo variableJacques Germishuys2014-09-121-3/+1
| | | | | | | | | | |
| * | | | | | | | | | Only check for workdir conflicts if the index has merged filesJacques Germishuys2014-09-121-0/+10
| | |_|/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing 0 as the length of the paths to check to git_diff_index_to_workdir results in all files being treated as conflicting, that is, all untracked or modified files in the worktree is reported as conflicting
* | | | | | | | | | attr: Cleanup the containing dir logicThe rugged tests are fragile2014-09-161-5/+5
| | | | | | | | | |
* | | | | | | | | | Fix attribute lookup in index for bare reposrb/attr-with-bareRussell Belfer2014-09-152-0/+28
| |_|/ / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using a bare repo with an index, libgit2 attempts to read files from the index. It caches those files based on the path to the file, specifically the path to the directory that contains the file. If there is no working directory, we use `git_path_dirname_r` to get the path to the containing directory. However, for the `.gitattributes` file in the root of the repository, this ends up normalizing the containing path to `"."` instead of the empty string and the lookup the `.gitattributes` data fails. This adds a test of attribute lookups on bare repos and also fixes the problem by simply rewriting `"."` to be `""`.
* | | | | | | | | Merge pull request #2554 from linquize/fetch-head-tagVicent Marti2014-09-151-2/+6
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | | When auto follow tags, FETCH_HEAD should list only newly followed tags
| * | | | | | | | When auto follow tags, FETCH_HEAD should list only newly followed tagsLinquize2014-09-061-2/+6
| |/ / / / / / /
* | | | | | | | signature: don't allow empty emailscmn/signature-empty-emailCarlos Martín Nieto2014-09-101-2/+2
| |/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A signature is made up of a non-empty name and a non-empty email so let's validate that. This also brings us more in line with git, which also rejects ident with an empty email.
* | | | | | | Merge pull request #2511 from libgit2/cmn/remote-default-restrictVicent Marti2014-09-092-25/+30
|\ \ \ \ \ \ \ | |_|_|_|/ / / |/| | | | | | Restrict which refs can be the default branch
| * | | | | | clone: handle overly restrictive refspecscmn/remote-default-restrictCarlos Martín Nieto2014-09-021-23/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the fetch refspec does not include the remote's default branch, it indicates an error in user expectations or programmer error. Error out in that case. This lets us get rid of the dummy refspec which can never work as its zeroed out. In the cases where we did not find a default branch, we set HEAD detached immediately, which lets us refactor the "normal" path, removing `found_branch`.
| * | | | | | clone: correct handling of an unborn HEADCarlos Martín Nieto2014-09-021-19/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the remote does not advertise HEAD, then it is unborn and we cannot checkout that branch. Handle it the same way as an empty repo.
| * | | | | | clone: support remotes with references but no branchesCarlos Martín Nieto2014-08-291-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A repository can have any number of references which we're not interested in such as notes or tags. For the default branch calculation we only care about branches. Make the decision about the number of branches rather than the number of refs in general.
| * | | | | | remote: short-circuit the default branch check if there is noneCarlos Martín Nieto2014-08-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we do not have a HEAD ref in the heads, we already know there is no default branch. Return immedately.
| * | | | | | remote: restrict default branch to branches namespaceCarlos Martín Nieto2014-08-291-0/+3
| |/ / / / /
* | | | | | reflog: Error handling on empty reflogVicent Marti2014-09-051-18/+15
| | | | | |
* | | | | | ssh: store error message immediately after a failed agent callcmn/ssh-errorsCarlos Martín Nieto2014-09-041-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the call to the agent fails, we must retrieve the error message just after the function call, as other calls may overwrite it. As the agent authentication is the only one which has a teardown and there does not seem to be a way to get the error message from a stored error number, this tries to introduce some small changes to store the error from the agent. Clearing the error at the beginning of the loop lets us know whether the agent has already set the libgit2 error message and we should skip it, or if we should set it.