summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | | | | | refspec: support asterisks in the middle of a patternCarlos Martín Nieto2014-07-041-18/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to assume a refspec would only have an asterisk in the middle of their respective pattern. This has not been a valid assumption for some time now with git. Instead of assuming where the asterisk is going to be, change the logic to treat each pattern as having two halves with a replacement bit in the middle, where the asterisk is.
| | * | | | | | refspec: short-circuit non-pattern refspecs on transformCarlos Martín Nieto2014-07-041-0/+10
| | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When transforming a non-pattern refspec, we simply need to copy over the opposite string. Move that logic up to the wrapper so we can assume a pattern refspec in the transformation function.
| * | | | | | Merge pull request #2468 from Airbitz/pack-error-reportingCarlos Martín Nieto2014-07-111-1/+1
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | Properly report failure when expanding a packfile
| | * | | | | | Properly report failure when expanding a packfileWilliam Swanson2014-07-091-1/+1
| | |/ / / / /
| * | | | | | merge: don't open COMMIT_MSG unless we need to append conflictsEdward Thomson2014-07-081-3/+4
| |/ / / / /
| * | | | | Include libssh2.h before git2.h (transport.h)Jacques Germishuys2014-07-031-2/+4
| |/ / / /
| * | | | Merge pull request #2460 from libgit2/cmn/sched-yieldVicent Marti2014-07-031-7/+0
| |\ \ \ \ | | | | | | | | | | | | Move yield to the tests and enable for FreeBSD
| | * | | | Move yield to the tests and enable for FreeBSDcmn/sched-yieldCarlos Martín Nieto2014-07-031-7/+0
| | | |_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | Move the definition of git_thread_yield() to the test which needs it and add the correct definition for it for FreeBSD and derivatives. Original patch adding FreeBSD and derivatives by @jacquesg.
| * | | | Merge pull request #2459 from libgit2/cmn/http-url-pathVicent Marti2014-07-031-0/+3
| |\ \ \ \ | | | | | | | | | | | | netops: error out on url without a path
| | * | | | netops: error out on url without a pathcmn/http-url-pathCarlos Martín Nieto2014-07-031-0/+3
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | In order to connect to a remote server, we need to provide a path to the repository we're interested in. Consider the lack of path in the url an error.
| * | | | Merge pull request #2449 from libgit2/cmn/maint-21Vicent Marti2014-07-021-1/+7
| |\ \ \ \ | | | | | | | | | | | | Maint fixes for ssl initing and ssh exposure
| | * | | | ssl: init only once without threadsCarlos Martín Nieto2014-06-301-1/+7
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OpenSSL library-loading functions do not expect to be called multiple times. Add a flag in the non-threaded libgit2 init so we only call once. This fixes #2446.
| * | | | Merge pull request #2453 from ethomson/checkout_indexVicent Marti2014-07-025-174/+161
| |\ \ \ \ | | | | | | | | | | | | git_checkout_index: checkout other indexes
| | * | | | git_checkout_index: checkout other indexesEdward Thomson2014-07-015-174/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git_checkout_index can now check out other git_index's (that are not necessarily the repository index). This allows checkout_index to use the repository's index for stat cache information instead of the index data being checked out. git_merge and friends now check out their indexes directly instead of trying to blend it into the running index.
| * | | | | Merge pull request #2452 from libgit2/cmn/clone-custom-repoVicent Marti2014-07-021-5/+20
| |\ \ \ \ \ | | | | | | | | | | | | | | Provide a callback to customize the repository on clone
| | * | | | | clone: remote git_clone_into{,_local} from the public APIcmn/clone-custom-repoCarlos Martín Nieto2014-07-021-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As git_clone now has callbacks to configure the details of the repository and remote, remove the lower-level functions from the public API, as they lack some of the logic from git_clone proper.
| | * | | | | clone: add a callback for repository creationCarlos Martín Nieto2014-07-021-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analogously to the remote creation callback, provide a way for the user of git_clone() to create the repository with whichever options they desire via callback.
| * | | | | | Merge pull request #2456 from libgit2/cmn/ssh-send-everythingVicent Marti2014-07-021-1/+12
| |\ \ \ \ \ \ | | |_|/ / / / | |/| | | | | ssh: libssh2_channel_write() behaves like send()
| | * | | | | ssh: libssh2_channel_write() behaves like send()cmn/ssh-send-everythingCarlos Martín Nieto2014-07-021-1/+12
| | | |/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the stream writing function was written, it assume that libssh2_channel_write() would always write all of the data to the wire. This is only true for the first 32k of data, which it tries to fit into one ssh packet. Since it can perform short writes, call it in a loop like we do for send(), advancing the buffer offset.
| * | | | | Round up pool alloc sizes for alignmentrb/round-up-pool-allocationsRussell Belfer2014-06-301-1/+1
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To make sure that items returned from pool allocations are aligned on nice boundaries, this rounds up all pool allocation sizes to a multiple of 8. This adds a small amount of overhead to each item. The rounding up could be made optional with an extra parameter to the pool initialization that turned on rounding only for pools where item alignment actually matters, but I think for the extra code and complexity that would be involved, that it makes sense just to burn a little bit of extra memory and enable this all the time.
| * | | | Merge pull request #2440 from phkelley/transportsVicent Marti2014-06-304-18/+46
| |\ \ \ \ | | | | | | | | | | | | Improvements to git_transport extensibility
| | * | | | Improvements to git_transport extensibilityPhilip Kelley2014-06-264-18/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git_remote_set_transport now takes a transport factory rather than a transport git_clone_options now allows the caller to specify a remote creation callback
| * | | | | Fix assert when receiving uncommon sideband packetPhilip Kelley2014-06-272-1/+8
| | | | | |
| * | | | | Fixes #2443 Zero size arrays are an extensionphkelley/flexarrayPhilip Kelley2014-06-261-1/+1
| |/ / / /
| * | | | pack: clean up error returnsCarlos Martín Nieto2014-06-252-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set a message when we fail to lock. Also make the put function void, since it's called from free, which cannot report errors. The only errors we can experience here are internal state corruption, so we assert that we are trying to put a pack which we have previously got.
| * | | | tree: free in error conditionsCarlos Martín Nieto2014-06-251-0/+2
| | | | | | | | | | | | | | | | | | | | As reported by coverity, we would leak some memory in error conditions.
| * | | | pack: free the new pack struct if we fail to insertCarlos Martín Nieto2014-06-252-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we fail to insert the packfile in the map, make sure to free it. This makes the free function only attempt to remove its mwindows from the global list if we have opened the packfile to avoid accessing the list unlocked.
| * | | | Update text=auto / core.autocrlf=false behaviorEdward Thomson2014-06-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Git for Windows 1.9.4 changed the behavior when the text=auto attribute is specified and core.autocrlf=false. Previous observed behavior would *not* filter files when going into the working directory, the new behavior *does* filter. Update our behavior to match.
| * | | | Merge remote-tracking branch 'upstream/cmn/mixed-eol-passthrough'Carlos Martín Nieto2014-06-242-7/+12
| |\ \ \ \
| | * | | | crlf: pass-through mixed EOL buffers from LF->CRLFcmn/mixed-eol-passthroughCarlos Martín Nieto2014-06-232-7/+12
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When checking out files, we're performing conversion into the user's native line endings, but we only want to do it for files which have consistent line endings. Refuse to perform the conversion for mixed-EOL files. The CRLF->LF filter is left as-is, as that conversion is considered to be normalization by git and should force a conversion of the line endings.
| * | | | Merge remote-tracking branch 'upstream/cmn/treebuilder-perf'Carlos Martín Nieto2014-06-242-58/+62
| |\ \ \ \
| | * | | | treentry: no need for manual size book-keepingcmn/treebuilder-perfCarlos Martín Nieto2014-06-102-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | We can simply ask the hasmap.
| | * | | | treebuilder: don't keep removed entries aroundCarlos Martín Nieto2014-06-102-35/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the user wants to keep a copy for themselves, they should make a copy. It adds unnecessary complexity to make sure the returned entries are valid until the builder is cleared.
| | * | | | treebuilder: use a map instead of vector to store the entriesCarlos Martín Nieto2014-06-102-51/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Finding a filename in a vector means we need to resort it every time we want to read from it, which includes every time we want to write to it as well, as we want to find duplicate keys. A hash-map fits what we want to do much more accurately, as we do not care about sorting, but just the particular filename. We still keep removed entries around, as the interface let you assume they were going to be around until the treebuilder is cleared or freed, but in this case that involves an append to a vector in the filter case, which can now fail. The only time we care about sorting is when we write out the tree, so let's make that the only time we do any sorting.
| * | | | | Merge branch 'cmn/global-mwf'Carlos Martín Nieto2014-06-246-14/+160
| |\ \ \ \ \
| | * | | | | Share packs across repository instancescmn/global-mwfCarlos Martín Nieto2014-06-236-14/+160
| | | |/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opening the same repository multiple times will currently open the same file multiple times, as well as map the same region of the file multiple times. This is not necessary, as the packfile data is immutable. Instead of opening and closing packfiles directly, introduce an indirection and allocate packfiles globally. This does mean locking on each packfile open, but we already use this lock for the global mwindow list so it doesn't introduce a new contention point.
| * | | | | Merge remote-tracking branch 'upstream/cmn/filebuf-atomic-unlock'Carlos Martín Nieto2014-06-232-4/+28
| |\ \ \ \ \ | | |/ / / / | |/| | | |
| | * | | | filebuf: make unlocking atomiccmn/filebuf-atomic-unlockCarlos Martín Nieto2014-06-042-4/+28
| | | |_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When renaming a lock file to its final location, we need to make sure that it is replaced atomically. We currently have a workaround for Windows by removing the target file. This means that the target file, which may be a ref or a packfile, may cease to exist for a short wile, which shold be avoided. Implement the workaround only in Windows, by making sure that the file we want to replace is writable.
| * | | | 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.
* | | | | | 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.