Commit Graph

7479 Commits

Author SHA1 Message Date
Carlos Martín Nieto
8156835df1 smart: store reported symrefs
The protocol has a capability which allows the server to tell us which
refs are symrefs, so we can e.g. know which is the default branch.

This capability is different from the ones we already support, as it's
not setting a flag to true, but requires us to store a list of
refspec-formatted mappings.

This commit does not yet expose the information in the reference
listing.
2014-05-21 12:12:32 +02:00
Carlos Martín Nieto
58532ed076 Merge pull request #2373 from kitbellew/fix-clone-into-mirror
Minor fix for cmn/clone-into-mirror.
2014-05-21 12:09:52 +02:00
Alan Rogers
61bef72dc3 Start adding GIT_DELTA_UNREADABLE and GIT_STATUS_WT_UNREADABLE. 2014-05-20 23:57:40 +10:00
Albert Meltzer
60cdf49583 Minor fix for cmn/clone-into-mirror.
A recently added check might skip initialization of old_fetchhead and go
directly to cleanup. So, destruct in the opposite order of construction.
2014-05-20 06:21:15 -07:00
Alan Rogers
f47bc8ff5e Skip unreadable files for now. 2014-05-20 18:16:04 +10:00
Alan Rogers
9055347944 Rename GIT_ENOACCESS -> GIT_EUNREADABLE 2014-05-20 17:40:28 +10:00
Carlos Martín Nieto
430866d28c Fix a leak in the tests 2014-05-20 08:29:51 +02:00
Carlos Martín Nieto
ac11219b80 smart: send a flush when we disconnect
The git server wants to hear a flush from us when we disconnect,
particularly when we want to perform a fetch but are up to date.
2014-05-20 02:41:45 +02:00
Albert Meltzer
62e562f92b Fix compiler warning (git_off_t cast to size_t).
Use size_t for page size, instead of long. Check result of sysconf.
Use size_t for page offset so no cast to size_t (second arg to p_mmap).
Use mod instead div/mult pair, so no cast to size_t is necessary.
2014-05-19 17:37:29 -07:00
Russell Belfer
c094197bf9 Just don't CRLF filter if there are no CRs 2014-05-19 15:05:39 -07: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
588a43af54 Merge pull request #2371 from martinwoodward/attrib_fnmatch
Restore attributions for fnmatch
2014-05-19 15:43:13 +02:00
Martin Woodward
213a269a50 Restore attributions for fnmatch 2014-05-19 14:39:45 +01: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
32332fccc9 clone: don't error out if the branch already exists
We set up the current branch after we fetch from the remote. This means
that the user's refspec may have already created this reference. It is
therefore not an error if we cannot create the branch because it already
exists.

This allows for the user to replicate git-clone's --mirror option.
2014-05-19 14:24:43 +02:00
Carlos Martín Nieto
3c607685da clone: duplicate the remote
Instead of changing the user-provided remote, duplicate it so we can add
the extra refspec without having to worry about unsetting it before
returning.
2014-05-19 14:24:43 +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
Vicent Marti
52b597b66e Merge pull request #2364 from libgit2/cmn/comment-char
message: don't assume the comment char
2014-05-19 12:21:37 +02:00
Vicent Marti
138af33717 Merge pull request #2303 from jacquesg/mingw-lseek
WIP: Windows fixes
2014-05-19 12:20:31 +02:00
Philip Kelley
b2a4be1d42 Merge pull request #2365 from kitbellew/fix-indexer-mmap
Fix warning on uninitialized variable.
2014-05-18 12:22:21 -04:00
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