Commit Graph

6911 Commits

Author SHA1 Message Date
Carlos Martín Nieto
d58a64e9a5 clone: add a callback for repository creation
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.
2014-07-02 07:05:00 +02:00
Vicent Marti
dcdb8500e3 Merge pull request #2440 from phkelley/transports
Improvements to git_transport extensibility
2014-06-30 17:35:42 +02:00
Vicent Marti
16e7596d78 Merge pull request #2447 from phkelley/pkt_assert
Fix assert when receiving uncommon sideband packet
2014-06-27 18:11:06 +02:00
Philip Kelley
bc8a088685 Fix assert when receiving uncommon sideband packet 2014-06-27 12:03:27 -04:00
Philip Kelley
1697cd6ff5 Improvements to git_transport extensibility
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
2014-06-26 22:34:37 -04:00
Vicent Marti
0145afe635 Merge pull request #2445 from ethomson/checkout_conflict_test
checkout::conflict tests: only test owner mode
2014-06-26 18:24:13 +02:00
Edward Thomson
f4046267dc checkout::conflict tests: only test owner mode
The checkout::conflict type conflict tests were failing because
they were overly assertive about the resultant mode, testing
group & other bits, which failed miserably for people who had a
umask less restrictive than 022.  Only test the resultant owner bits.
2014-06-26 09:16:12 -04:00
Philip Kelley
9c46409d38 Merge pull request #2444 from libgit2/phkelley/flexarray
Fixes #2443 Zero size arrays are an extension
2014-06-26 08:01:01 -04:00
Philip Kelley
f36d57b9bf Fixes #2443 Zero size arrays are an extension 2014-06-26 07:48:09 -04:00
Vicent Marti
86cb34cb11 Merge pull request #2442 from libgit2/cmn/leaks
Fix a couple of leaks
2014-06-25 21:43:52 +02:00
Carlos Martín Nieto
c19b1c0442 pack: clean up error returns
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.
2014-06-25 21:35:58 +02:00
Carlos Martín Nieto
966fb20702 tree: free in error conditions
As reported by coverity, we would leak some memory in error conditions.
2014-06-25 21:25:44 +02:00
Carlos Martín Nieto
5e0f47c375 pack: free the new pack struct if we fail to insert
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.
2014-06-25 21:20:39 +02:00
Carlos Martín Nieto
c61dc1a92e travis: build the master branch
We need to tell Travis to build the master branch or it won't build it
or the pull requests.
2014-06-25 17:12:44 +02:00
Vicent Marti
1fe562434d Merge pull request #2435 from ethomson/text_attr
Update text=auto / core.autocrlf=false behavior
2014-06-25 15:14:20 +02:00
Vicent Marti
a252b9e245 Merge pull request #2439 from ethomson/revert_export
Export git_revert_commit
2014-06-25 15:14:14 +02:00
Edward Thomson
4e813a8b60 Export git_revert_commit 2014-06-25 09:11:16 -04:00
Edward Thomson
d412165f94 Update text=auto / core.autocrlf=false behavior
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.
2014-06-24 13:46:32 -04:00
Carlos Martín Nieto
e1fc03c9ba Add CHANGELOG entry for mixed-EOL fix 2014-06-24 17:56:27 +02:00
Carlos Martín Nieto
3ddd0d929d Merge remote-tracking branch 'upstream/cmn/mixed-eol-passthrough' 2014-06-24 17:55:15 +02:00
Carlos Martín Nieto
29fe897d80 Add CHANGELOG entry for treebuilder map 2014-06-24 17:52:52 +02:00
Carlos Martín Nieto
5e37874dd4 Merge remote-tracking branch 'upstream/cmn/treebuilder-perf' 2014-06-24 17:51:45 +02:00
Carlos Martín Nieto
130cb54801 Add CHANGELOG entry for shared packs 2014-06-24 17:37:41 +02:00
Carlos Martín Nieto
5815266981 Merge branch 'cmn/global-mwf' 2014-06-24 17:35:14 +02:00
Vicent Marti
35757155f5 Merge pull request #2434 from libgit2/rb/contributing-updates
Update CONTRIBUTING and PROJECTS
2014-06-24 17:30:47 +02:00
Carlos Martín Nieto
5a76ad35aa crlf: pass-through mixed EOL buffers from LF->CRLF
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.
2014-06-23 22:27:12 +02:00
Carlos Martín Nieto
b3b66c5793 Share packs across repository instances
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.
2014-06-23 21:50:36 +02:00
Carlos Martín Nieto
d30447cbaf Add a CHANGELOG entry for the filebuf change 2014-06-23 18:02:59 +02:00
Carlos Martín Nieto
461da57aff Merge remote-tracking branch 'upstream/cmn/filebuf-atomic-unlock' 2014-06-23 17:32:30 +02:00
Russell Belfer
b247a39d87 missing paren 2014-06-20 10:15:03 -07:00
Russell Belfer
a142ed91e5 Update CONTRIBUTING and PROJECTS
This updates CONTRIBUTING to reflect the changes to use the
master branch and make explicit recommendations about updating
CHANGELOG.md and providing test coverage.  Also, this includes
some old updates to PROJECTS.md that I wrote to expand the list
of projects, pulling in things from old feature requests.
2014-06-20 10:10:38 -07:00
Vicent Marti
28f087c864 libgit2 v0.21.0 2014-06-20 14:42:16 +02:00
Vicent Marti
1589aa0c4d Merge pull request #2425 from libgit2/cmn/clone-auth-change
Don't use read-write accounts for the tests
2014-06-16 11:11:40 +02:00
Vicent Marti
e93206e0f5 Merge pull request #2421 from libgit2/cmn/init-ssl-once
netops: init OpenSSL once under lock
2014-06-14 12:58:03 +02:00
Carlos Martín Nieto
09561d33e4 test: remove assembla clone test
The assembla failure we were seeing referred to a private repository,
which is not what is there at the moment.

This reverts 1fd21b0342
2014-06-13 22:27:46 +02:00
Carlos Martín Nieto
3382d8b14f test: use read-only account
Don't write in plaintext the password of an account which has full
control over the repository. Instead use an account with read-only
access.
2014-06-13 22:24:43 +02:00
Carlos Martín Nieto
9c3e4e97f6 http: fix typo in credentials logic
We want to check whether the credentials callback is NULL, not whether
the payload is.
2014-06-13 02:35:33 +02:00
Carlos Martín Nieto
081e76bac2 ssl: init everything all the time
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).
2014-06-12 16:58:25 +02:00
Carlos Martín Nieto
8f897b6f2f ssl: init also without threads 2014-06-12 14:50:08 +02:00
Carlos Martín Nieto
cf15ac8aa9 ssl: cargo-cult thread safety
OpenSSL's tests init everything in the main thread, so let's do that.
2014-06-12 14:37:03 +02:00
Carlos Martín Nieto
5fa0494328 ssl: use locking
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.
2014-06-11 23:19:48 +02:00
Carlos Martín Nieto
76f76162b2 remote: update documentation
Add docs for git_clone_local_t and move the docs for the
git_clone_options to each field.
2014-06-11 21:20:23 +02:00
Carlos Martín Nieto
1d3364ac9d netops: init OpenSSL once under lock
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.
2014-06-11 20:54:42 +02:00
Vicent Marti
3f3d21badd Merge pull request #2417 from libgit2/cmn/revwalk-array-fix
revwalk: more sensible array handling
2014-06-11 18:56:24 +02:00
Carlos Martín Nieto
f9a9766794 revwalk: more sensible array handling
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.
2014-06-11 00:06:44 +02:00
Carlos Martín Nieto
fcc6006607 treentry: no need for manual size book-keeping
We can simply ask the hasmap.
2014-06-10 15:14:13 +02:00
Carlos Martín Nieto
978fbb4c34 treebuilder: don't keep removed entries around
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.
2014-06-10 15:14:13 +02:00
Carlos Martín Nieto
4d3f1f9740 treebuilder: use a map instead of vector to store the entries
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.
2014-06-10 15:14:13 +02:00
Vicent Marti
7064cdafbd Merge pull request #2416 from libgit2/cmn/treebuilder-insert-sorted
treebuilder: insert sorted
2014-06-10 12:56:11 +02:00
Carlos Martín Nieto
17fbf852a5 pathspec: use C guards in header 2014-06-10 03:53:26 +02:00