Commit Graph

870 Commits

Author SHA1 Message Date
Russell Belfer
5fa8cda981 Round up pool alloc sizes for alignment
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.
2014-06-30 12:05:25 -07:00
Vicent Marti
dcdb8500e3 Merge pull request #2440 from phkelley/transports
Improvements to git_transport extensibility
2014-06-30 17:35:42 +02: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
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
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
3ddd0d929d Merge remote-tracking branch 'upstream/cmn/mixed-eol-passthrough' 2014-06-24 17:55:15 +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
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
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
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
ce5e6617b0 Merge pull request #2407 from libgit2/cmn/remote-rename-more
More remote rename fixes
2014-06-08 16:44:32 +02:00
Philip Kelley
fb5917679d Win32: Fix object::cache::threadmania test on x64 2014-06-07 12:51:48 -04:00
Philip Kelley
daf2a648b1 Win32: Fix diff::workdir::submodules test #2361 2014-06-07 12:18:56 -04:00
Philip Kelley
6d1b04383e Win32: Fix failing clone_mirror test 2014-06-07 12:18:24 -04:00
Carlos Martín Nieto
231f350d91 remote: don't free the remote on delete
This was a bad idea. Don't free except in the free function.
2014-06-06 22:55:34 +02:00
Carlos Martín Nieto
eb6aa791a7 remote: failing test for renaming with a symref 2014-06-06 22:36:41 +02:00
Carlos Martín Nieto
72bca13e5d remote: return problem refspecs instead of using a callback
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.
2014-06-06 21:43:04 +02:00
Carlos Martín Nieto
fe3b9d0731 remote: failing test for rename
When there is a reference in the target namespace, we should overwrite
it. Instead it gets a different name under the current code.
2014-06-06 00:54:11 +02:00
Russell Belfer
dfcba09e67 Merge pull request #2395 from libgit2/cmn/ref-iter-concurrent
Concurrent ref iterator access
2014-06-03 13:05:20 -07:00
Vicent Marti
bccb36ebf9 Merge pull request #2389 from arthurschreiber/arthur/set-error-when-no-remote-found
Remote: Set an error when a remote cannot be found.
2014-06-03 17:25:59 +02:00
Carlos Martín Nieto
69a1a6918c Plug a leak in the tests 2014-06-03 16:18:08 +02:00
Carlos Martín Nieto
4ee2543c5a refs: failing test for concurrent ref access
If we remove a reference while we're iterating through the packed refs,
the position in the iterator will be off.
2014-06-02 16:46:47 +02:00
Arthur Schreiber
d723dbed0c Remote: Set an error when a remote cannot be found.
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.
2014-05-30 19:26:49 +02:00
Edward Thomson
49837fd49f Ignore core.safecrlf=warn until we have a warn infrastructure 2014-05-30 11:30:53 -05:00
Arthur Schreiber
9d6c3d2853 Refs: Extend unicode test for branch creation.
This adds another assertion to ensure that the reference name inside
the git_reference struct returned by `git_branch_create` is returned as
precomposed if `core.precomposeunicode` is enabled.
2014-05-30 15:15:54 +02:00
Arthur Schreiber
1a90b1e3f1 Refs: Add a unicode test for git_branch_move.
This tests that decomposed branch names are correctly precomposed when
passed to `git_branch_move` and `core.precomposeunicode` is enabled.
2014-05-30 14:53:28 +02:00
Vicent Marti
31c551528b Merge pull request #2011 from libgit2/cmn/clone-local
Local clone
2014-05-29 14:50:57 +02:00
Carlos Martín Nieto
bc9f67fa85 clone: more explicit local tests
Assert the exact amount of links we expect. While there, check that a
plain git_clone() automatically chooses to link.
2014-05-29 10:06:48 +02:00
Carlos Martín Nieto
2614819cf3 clone: allow for linking in local clone
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).
2014-05-28 15:40:47 +02:00
Carlos Martín Nieto
94f742bac6 fileops: allow linking files when copying directory structures
When passed the LINK_FILES flag, the recursive copy will hardlink files
instead of copying them.
2014-05-28 15:40:22 +02:00
Carlos Martín Nieto
c1dbfcbb4a clone: add flag not to link 2014-05-28 15:40:22 +02:00
Carlos Martín Nieto
121b26738e clone: add flags to override whether to perform a local clone 2014-05-28 15:40:22 +02:00
Vicent Marti
5d91bea22a Merge pull request #2380 from libgit2/cmn/index-add-modes
index: check for valid filemodes on add
2014-05-28 13:55:57 +02:00
Vicent Marti
ab882e21b4 Merge pull request #2385 from karipe/development
Fix compile error on Visual Studio
2014-05-28 13:49:38 +02:00
Edward Thomson
eff531e103 Modify GIT_MERGE_CONFIG -> GIT_MERGE_PREFERENCE 2014-05-27 20:58:20 -05:00
Edward Thomson
a3622ba6cc Move GIT_MERGE_CONFIG_* to its own enum 2014-05-27 20:49:20 -05:00
Edward Thomson
d362093f9e Introduce GIT_MERGE_CONFIG_* for merge.ff settings
git_merge_analysis will now return GIT_MERGE_CONFIG_NO_FASTFORWARD
when merge.ff=false and GIT_MERGE_CONFIG_FASTFORWARD_ONLY when
merge.ff=true
2014-05-27 20:49:16 -05:00
Cha, Hojeong
3ac1ff42d7 Fix compile error on Visual Studio 2014-05-27 23:36:07 +09:00
Carlos Martín Nieto
052a2ffde4 index: check for valid filemodes on add 2014-05-22 16:01:02 +02:00
Vicent Marti
a598264463 Merge pull request #2376 from libgit2/cmn/remote-symref
Add support for the symref extension
2014-05-22 02:28:42 +02:00
Vicent Marti
7ee233a920 Merge pull request #2375 from libgit2/rb/safecrlf-on-lf-platform
Make core.safecrlf not generate an error on LF-ending platforms
2014-05-22 02:27:33 +02:00
Carlos Martín Nieto
d22db24fb7 remote: add api to guess the remote's default branch
If the remote supports the symref protocol extension, then we return
that, otherwise we guess with git's rules.
2014-05-21 12:12:32 +02:00
Carlos Martín Nieto
306475eb01 remote: expose the remote's symref mappings
Add a symref_target field to git_remote_head to expose the symref
mappings to the user.
2014-05-21 12:12:32 +02:00
Carlos Martín Nieto
430866d28c Fix a leak in the tests 2014-05-20 08:29:51 +02:00
Russell Belfer
16798d08cf Make core.safecrlf work on LF-ending platforms
If you enabled core.safecrlf on an LF-ending platform, we would
error even for files with all LFs.  We should only be warning on
irreversible mappings, I think.
2014-05-19 14:57:09 -07:00
Vicent Marti
124a45ead3 Merge pull request #2354 from libgit2/cmn/clone-into-mirror
Allow mirror-clone via `git_clone_into()`
2014-05-19 15:00:50 +02:00
Carlos Martín Nieto
b206724863 clone: add failing test for a mirror-clone with clone_into
Show a failure to perform a mirror-clone from a repository, both local
and remote.
2014-05-19 14:24:43 +02: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