summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* clone: get rid of head_infocmn/remote-symrefCarlos Martín Nieto2014-05-211-23/+12
| | | | | Since we no longer need to push data to callbacks, there's no need for this truct.
* clone: make use of the remote's default branch guessingCarlos Martín Nieto2014-05-211-67/+17
| | | | | Let's use the remote's default branch guessing instead of reinventing one ourselves with callbacks.
* remote: add api to guess the remote's default branchCarlos Martín Nieto2014-05-211-0/+47
| | | | | If the remote supports the symref protocol extension, then we return that, otherwise we guess with git's rules.
* local transport: expose the symref dataCarlos Martín Nieto2014-05-211-4/+18
| | | | | When using the local transport, we always have the symbolic information available, so fill it.
* remote: expose the remote's symref mappingsCarlos Martín Nieto2014-05-212-0/+20
| | | | | Add a symref_target field to git_remote_head to expose the symref mappings to the user.
* smart: store reported symrefsCarlos Martín Nieto2014-05-213-7/+82
| | | | | | | | | | | | 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.
* Minor fix for cmn/clone-into-mirror.Albert Meltzer2014-05-201-4/+2
| | | | | A recently added check might skip initialization of old_fetchhead and go directly to cleanup. So, destruct in the opposite order of construction.
* Merge pull request #2371 from martinwoodward/attrib_fnmatchVicent Marti2014-05-192-3/+58
|\ | | | | Restore attributions for fnmatch
| * Restore attributions for fnmatchMartin Woodward2014-05-192-3/+58
| |
* | Merge pull request #2354 from libgit2/cmn/clone-into-mirrorVicent Marti2014-05-191-15/+16
|\ \ | |/ |/| Allow mirror-clone via `git_clone_into()`
| * clone: don't error out if the branch already existscmn/clone-into-mirrorCarlos Martín Nieto2014-05-191-0/+4
| | | | | | | | | | | | | | | | | | 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.
| * clone: duplicate the remoteCarlos Martín Nieto2014-05-191-15/+12
| | | | | | | | | | | | 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.
* | Merge pull request #2364 from libgit2/cmn/comment-charVicent Marti2014-05-191-2/+2
|\ \ | | | | | | message: don't assume the comment char
| * | message: don't assume the comment charcmn/comment-charCarlos Martín Nieto2014-05-181-2/+2
| | | | | | | | | | | | | | | 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.
* | | Merge pull request #2303 from jacquesg/mingw-lseekVicent Marti2014-05-193-2/+3
|\ \ \ | | | | | | | | WIP: Windows fixes
| * | | git_pool_mallocsz takes an unsigned longJacques Germishuys2014-05-011-1/+1
| | | |
| * | | _InterlockedExchange expects a volatile LONGJacques Germishuys2014-05-011-1/+1
| | | |
| * | | Undef lseek firstJacques Germishuys2014-05-011-0/+1
| | | |
* | | | Fix warning on uninitialized variable.Albert Meltzer2014-05-181-1/+1
| |/ / |/| |
* | | Fix printf format string from previous commitPhilip Kelley2014-05-171-1/+1
| | |
* | | print_binary_hunk: Treat types with respectPhilip Kelley2014-05-171-7/+24
| | |
* | | Merge remote-tracking branch 'upstream/cmn/indexer-mmap' into developmentPhilip Kelley2014-05-178-73/+111
|\ \ \
| * | | indexer: mmap fixes for Windowscmn/indexer-mmapCarlos Martín Nieto2014-05-174-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | indexer: use mmap for writingCarlos Martín Nieto2014-05-176-72/+102
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge pull request #2362 from libgit2/rb/update-4k-to-8kVicent Marti2014-05-173-2/+11
|\ \ \ \ | |/ / / |/| | | Test and fix Git diff binary detection compatibility
| * | | Increase binary detection len to 8kRussell Belfer2014-05-163-2/+11
| | | |
* | | | Win32: Supply _O_NOINHERIT when calling _wopenPhilip Kelley2014-05-161-2/+11
| | | |
* | | | Merge pull request #2313 from libgit2/cmn/remote-deleteVicent Marti2014-05-161-3/+145
|\ \ \ \ | |/ / / |/| | | Remote deletion
| * | | remote: remove remote-tracking branches on deleteCarlos Martín Nieto2014-05-161-4/+54
| | | | | | | | | | | | | | | | | | | | When we delete a remote, we also need to go through its fetch refspecs and remove the references they create locally.
| * | | remote: move branch upstream deletion to use an iteratorCarlos Martín Nieto2014-04-301-57/+38
| | | | | | | | | | | | | | | | This should make it more readable and allocate a bunch fewer strings.
| * | | remote: Introduce git_remote_delete()nulltoken2014-04-301-3/+114
| | | |
* | | | pack: init the cache on packfile alloccmn/pack-cache-initCarlos Martín Nieto2014-05-151-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Fix mutex init/free in config_file.cPhilip Kelley2014-05-151-1/+4
| |_|/ |/| |
* | | Merge pull request #2351 from linquize/init-varVicent Marti2014-05-141-1/+1
|\ \ \ | | | | | | | | Initialize local variable
| * | | Initialize local variableLinquize2014-05-131-1/+1
| | | |
* | | | Increase use of config snapshotsrb/coverity-fixesRussell Belfer2014-05-137-53/+69
| | | | | | | | | | | | | | | | And decrease extra reload checks of config data.
* | | | Some coverity inspired cleanupsRussell Belfer2014-05-134-20/+24
|/ / /
* | | Merge pull request #2328 from libgit2/rb/how-broken-can-ignores-beVicent Marti2014-05-137-105/+112
|\ \ \ | | | | | | | | Improve checks for ignore containment
| * | | Improve checks for ignore containmentrb/how-broken-can-ignores-beRussell Belfer2014-05-067-105/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The diff code was using an "ignored_prefix" directory to track if a parent directory was ignored that contained untracked files alongside tracked files. Unfortunately, when negative ignore rules were used for directories inside ignored parents, the wrong rules were applied to untracked files inside the negatively ignored child directories. This commit moves the logic for ignore containment into the workdir iterator (which is a better place for it), so the ignored-ness of a directory is contained in the frame stack during traversal. This allows a child directory to override with a negative ignore and yet still restore the ignored state of the parent when we traverse out of the child. Along with this, there are some problems with "directory only" ignore rules on container directories. Given "a/*" and "!a/b/c/" (where the second rule is a directory rule but the first rule is just a generic prefix rule), then the directory only constraint was having "a/b/c/d/file" match the first rule and not the second. This was fixed by having ignore directory-only rules test a rule against the prefix of a file with LEADINGDIR enabled. Lastly, spot checks for ignores using `git_ignore_path_is_ignored` were tested from the top directory down to the bottom to deal with the containment problem, but this is wrong. We have to test bottom to top so that negative subdirectory rules will be checked before parent ignore rules. This does change the behavior of some existing tests, but it seems only to bring us more in line with core Git, so I think those changes are acceptable.
* | | | Merge pull request #2330 from libgit2/cmn/pack-unpack-loopVicent Marti2014-05-132-78/+211
|\ \ \ \ | | | | | | | | | | Make pack object lookup use loops
| * | | | pack: don't forget to cache the base objectcmn/pack-unpack-loopCarlos Martín Nieto2014-05-131-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | The base object is a good cache candidate, so we shouldn't forget to add it to the cache.
| * | | | pack: use stack allocation for smaller delta chainsCarlos Martín Nieto2014-05-131-16/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoid allocating the array on the heap for relatively small chains. The expected performance increase is sadly not really noticeable.
| * | | | pack: expose a cached delta base directlyCarlos Martín Nieto2014-05-132-97/+92
| | | | | | | | | | | | | | | | | | | | | | | | | Instead of going through a special entry in the chain, let's pass it as an output parameter.
| * | | | pack: simplify delta chain codeCarlos Martín Nieto2014-05-091-49/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | pack: preallocate a 64-element chainCarlos Martín Nieto2014-05-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | pack: make sure not to leak the dep chainCarlos Martín Nieto2014-05-091-8/+13
| | | | |
| * | | | pack: use a cache for delta bases when unpackingCarlos Martín Nieto2014-05-092-73/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | pack: unpack using a loopCarlos Martín Nieto2014-05-092-25/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | pack: do not repeat the same error message four timesCarlos Martín Nieto2014-05-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Repeating this error message makes it harder to find out where we actually are finding the error, and they don't really describe what we're trying to do.
| * | | | pack: remove misleading commentCarlos Martín Nieto2014-05-091-7/+0
| | | | |