Commit Graph

7459 Commits

Author SHA1 Message Date
Albert Meltzer
9c4feef9f8 Fix warning on uninitialized variable. 2014-05-18 07:27:06 -07:00
Carlos Martín Nieto
49e369b29d message: don't assume the comment char
The comment char is configurable and we need to provide a way for the
user to specify which comment char they chose for their message.
2014-05-18 10:06:49 +02:00
Philip Kelley
d7a294633d Fix a bug in the pack::packbuilder suite 2014-05-17 16:58:09 -04:00
Philip Kelley
4c9ffdff76 Fix printf format string from previous commit 2014-05-17 12:45:34 -04:00
Philip Kelley
c6320bec93 print_binary_hunk: Treat types with respect 2014-05-17 12:19:32 -04:00
Philip Kelley
bf6a5b6143 Merge remote-tracking branch 'upstream/cmn/indexer-mmap' into development 2014-05-17 11:38:03 -04:00
Vicent Marti
191ff93609 Merge pull request #2362 from libgit2/rb/update-4k-to-8k
Test and fix Git diff binary detection compatibility
2014-05-17 02:37:13 +02:00
Carlos Martín Nieto
0731a5b4db indexer: mmap fixes for Windows
Windows has its own ftruncate() called _chsize_s().

p_mkstemp() is changed to use p_open() so we can make sure we open for
writing; the addition of exclusive create is a good thing to do
regardless, as we want a temporary path for ourselves.

Lastly, MSVC doesn't quite know how to add two numbers if one of them is a
void pointer, so let's alias it to unsigned char.C
2014-05-17 01:39:43 +02:00
Carlos Martín Nieto
f7310540ae indexer: use mmap for writing
Some OSs cannot keep their ideas about file content straight when mixing
standard IO with file mapping. As we use mmap for reading from the
packfile, let's make writing to the pack file use mmap.
2014-05-17 01:39:43 +02:00
Russell Belfer
8af4966db1 Git binary check compat tests
A variety of data patterns for diffs verified to match the
behavior of binary detection with Git on the command line.
2014-05-16 16:30:58 -07:00
Russell Belfer
d0f00de4d8 Increase binary detection len to 8k 2014-05-16 11:08:19 -07:00
Russell Belfer
adebcb1645 Merge pull request #2360 from phkelley/noinherit
Win32: Supply _O_NOINHERIT when calling _wopen
2014-05-16 10:42:17 -07:00
Philip Kelley
f0b820dd67 Win32: Supply _O_NOINHERIT when calling _wopen 2014-05-16 12:38:56 -04:00
Edward Lee
bafaf790cd Fixed permissions on template directories. 2014-05-16 08:09:20 -04:00
Vicent Marti
228272ef58 Merge pull request #2313 from libgit2/cmn/remote-delete
Remote deletion
2014-05-16 11:56:37 +02:00
Carlos Martín Nieto
ec8a949a58 remote: remove remote-tracking branches on delete
When we delete a remote, we also need to go through its fetch refspecs
and remove the references they create locally.
2014-05-16 10:02:07 +02:00
Russell Belfer
8e1b5a8dc6 Merge pull request #2357 from libgit2/cmn/pack-cache-init
pack: init the cache on packfile alloc
2014-05-15 15:31:13 -07:00
Vicent Marti
88b1b36dfc Merge pull request #2356 from libgit2/rb/restore-search-paths
Better global search path sandboxing in tests
2014-05-15 20:25:54 +02:00
Carlos Martín Nieto
649214be4b pack: init the cache on packfile alloc
When running multithreaded, it is not enough to check for the offmap
allocation. Move the call to cache_init() to packfile allocation so we
can be sure it is always allocated free of races.

This fixes #2355.
2014-05-15 19:59:05 +02:00
Russell Belfer
8487e23797 Better search path sandboxing
There are a number of tests that modify the global or system
search paths during the tests.  This adds a helper function to
make it easier to restore those paths and makes sure that they
are getting restored in a manner that preserves test isolation.
2014-05-15 10:56:28 -07:00
Philip Kelley
4af0ef9690 Fix mutex init/free in config_file.c 2014-05-15 11:09:49 -04:00
Alan Rogers
dc4906f12a Skip unreadable files for now. 2014-05-15 17:40:28 +10:00
Alan Rogers
158c8ba1ee Return a specific error for EACCES. 2014-05-15 16:54:46 +10:00
Alan Rogers
8d3a2d5fc5 Simplify the test. 2014-05-15 16:33:26 +10:00
Vicent Marti
7851e595ad Merge pull request #2351 from linquize/init-var
Initialize local variable
2014-05-14 16:05:23 +02:00
Vicent Marti
2bcc1afd10 Merge pull request #2349 from libgit2/rb/coverity-fixes
Increase config snapshot usage
2014-05-14 12:20:24 +02:00
Vicent Marti
a8af3e0284 Merge pull request #2348 from stewid/add-link-R-bindings
Add R bindings to the README
2014-05-14 12:18:57 +02:00
Alan Rogers
2b5a99d8ff Add a test (failing) for a work tree status.
When thees is an unreadable folder, we should still be able
to enumerate status.
2014-05-14 17:02:07 +10:00
Russell Belfer
2b52a0bfae Increase use of config snapshots
And decrease extra reload checks of config data.
2014-05-13 16:32:27 -07:00
Russell Belfer
a37aa82ea6 Some coverity inspired cleanups 2014-05-13 15:54:23 -07:00
Stefan Widgren
562516eceb Add R bindings to the README 2014-05-13 22:43:59 +02:00
Linquize
b3f27c4368 Initialize local variable 2014-05-13 21:08:50 +08:00
Vicent Marti
03fcef1889 Merge pull request #2328 from libgit2/rb/how-broken-can-ignores-be
Improve checks for ignore containment
2014-05-13 12:40:13 +02:00
Vicent Marti
bcf9792f08 Merge pull request #2330 from libgit2/cmn/pack-unpack-loop
Make pack object lookup use loops
2014-05-13 12:36:51 +02:00
Vicent Marti
e161962634 Merge pull request #2346 from kitbellew/fix2300
Minor fix for previously merged netops code.
2014-05-13 12:35:56 +02:00
Albert Meltzer
7c57cd97d8 Win32 fix for #2300.
The code doesn't use SSL and a test requires it.
2014-05-12 20:51:03 -07:00
Carlos Martín Nieto
c968ce2c2c pack: don't forget to cache the base object
The base object is a good cache candidate, so we shouldn't forget to add
it to the cache.
2014-05-13 02:48:52 +02:00
Carlos Martín Nieto
15bcced223 pack: use stack allocation for smaller delta chains
This avoid allocating the array on the heap for relatively small
chains. The expected performance increase is sadly not really
noticeable.
2014-05-13 02:48:52 +02:00
Carlos Martín Nieto
a3ffbf230e pack: expose a cached delta base directly
Instead of going through a special entry in the chain, let's pass it as
an output parameter.
2014-05-13 02:48:48 +02:00
Russell Belfer
df3419269b Merge pull request #2336 from libgit2/rb/unicode-branch-names
Pass unconverted Unicode path data when iconv doesn't like it
2014-05-12 10:51:56 -07:00
Russell Belfer
af567e8853 Merge pull request #2334 from libgit2/rb/fix-2333
Be more careful with user-supplied buffers
2014-05-12 10:44:13 -07:00
Russell Belfer
ce3b71d91b Don't scale diff stat when not needed 2014-05-12 10:28:45 -07:00
Russell Belfer
b1914c3651 Minor fixes for warnings and error propagation 2014-05-12 10:24:46 -07:00
Russell Belfer
7bcced44b7 Merge pull request #2300 from libgit2/cmn/match-host-tests
Some improvements to the cert checking
2014-05-12 10:15:30 -07:00
Russell Belfer
d2c4d1c63d Merge pull request #2188 from libgit2/cmn/config-snapshot
Configuration snapshotting
2014-05-12 10:04:52 -07:00
Carlos Martín Nieto
9dbd150f5f pack: simplify delta chain code
The switch makes the loop somewhat unwieldy. Let's assume it's fine and
perform the check when we're accessing the data.

This makes our code look a lot more like git's.
2014-05-09 09:59:24 +02:00
Carlos Martín Nieto
b2559f477a pack: preallocate a 64-element chain
Dependency chains are often large and require a few
reallocations. Allocate a 64-element chain before doing anything else to
avoid allocations during the loop.

This value comes from the stack-allocated one git uses. We still
allocate this on the heap, but it does help performance a little bit.
2014-05-09 09:40:29 +02:00
Carlos Martín Nieto
e6d10c58b5 pack: make sure not to leak the dep chain 2014-05-09 09:40:29 +02:00
Carlos Martín Nieto
a332e91c92 pack: use a cache for delta bases when unpacking
Bring back the use of the delta base cache for unpacking objects. When
generating the delta chain, we stop when we find a delta base in the
pack's cache and use that as the starting point.
2014-05-09 09:40:29 +02:00
Carlos Martín Nieto
2acdf4b854 pack: unpack using a loop
We currently make use of recursive function calls to unpack an object,
resolving the deltas as we come back down the chain. This means that we
have unbounded stack growth as we look up objects in a pack.

This is now done in two steps: first we figure out what the dependency
chain is by looking up the delta bases until we reach a non-delta
object, pushing the information we need onto a stack and then we pop
from that stack and apply the deltas until there are no more left.

This version of the code does not make use of the delta base cache so it
is slower than what's in the mainline. A later commit will reintroduce
it.
2014-05-09 09:40:29 +02:00