- 14 Sep, 2012 6 commits
-
-
Defining the BOM as a string makes the array include the NUL-terminator, which means that the memcpy is going to check for that as well and thus never match for a nonempty file. Define the array as three chars, which makes the size correct.
Carlos Martín Nieto committed -
I don't think clone.c needs in #include dirent.h and it is not portable, so let's just get rid of it.
Russell Belfer committed -
Fix MSVC compilation warnings
Russell Belfer committed -
nulltoken committed
-
pack: iterate objects in offset order
Vicent Martí committed -
Compute the ordering on demand and persist until the index is freed.
David Michael Barr committed
-
- 13 Sep, 2012 1 commit
-
-
The winhttp branch was based on a version before these existed, so the build broke on Windows.
Carlos Martín Nieto committed
-
- 14 Sep, 2012 2 commits
-
-
http: use WinHTTP on Windows
Vicent Martí committed -
Wondows has its own HTTP library. Use that one when possible instead of our own. As we don't depend on them anymore, remove the http-parser library from the Windows build, as well as the search for OpenSSL.
Carlos Martín Nieto committed
-
- 13 Sep, 2012 10 commits
-
-
Fix error text s/buffer too long/buffer too short/
Vicent Martí committed -
Sascha Cunz committed
-
Fix problems in diff iterator record chaining
Vicent Martí committed -
The last change tweaked the way we use the hunk_curr pointer during iteration, but failed to reset the value back to NULL when switching files.
Russell Belfer committed -
refspec: No remote tracking ref from a fetchspec-less remote
Vicent Martí committed -
nulltoken committed
-
There is a bug in building the linked list of line records in the diff iterator and also an off by one element error in the hunk counts. This fixes both of these, adds some test data with more complex sets of hunk and line diffs to exercise this code better.
Russell Belfer committed -
Add git_repository_hashfile to hash with filters
Vicent Martí committed -
odb_pack: try lookup before refreshing packs
Vicent Martí committed -
Michael Schubert committed
-
- 12 Sep, 2012 2 commits
-
-
This reduces the rate of syscalls for the common case of sequences of object reads from the same pack. Best of 5 timings for libgit2_clar before this patch: real 0m5.375s user 0m0.392s sys 0m3.564s After applying this patch: real 0m5.285s user 0m0.356s sys 0m3.544s 0.6% improvement in system time. 9.2% improvement in user time. 1.7% improvement in elapsed time. Confirmed a 0.6% reduction in number of system calls with strace. Expect greater improvement for graph-traversal with large packs.
David Michael Barr committed -
Fixed some minor `git_repository_hashfile` issues: - Fixed incorrect doc (saying that repo could be NULL) - Added checking of object type value to acceptable ones - Added more tests for various parameter permutations
Russell Belfer committed
-
- 11 Sep, 2012 9 commits
-
-
The existing `git_odb_hashfile` does not apply text filtering rules because it doesn't have a repository context to evaluate the correct rules to apply. This adds a new hashfile function that will apply repository-specific filters (based on config, attributes, and filename) before calculating the hash.
Russell Belfer committed -
git_mergebase: Constness-Fix for consistency
Vicent Martí committed -
Vicent Marti committed
-
Vicent Marti committed
-
In the process of adding tests for the max file size threshold (which treats files over a certain size as binary) there seem to be a number of problems in the new code with detecting binaries. This should fix those up, as well as add a test for the file size threshold stuff. Also, this un-deprecates `GIT_DIFF_LINE_ADD_EOFNL`, since I finally found a legitimate situation where it would be returned.
Russell Belfer committed -
cache: fix race condition
Vicent Martí committed -
Example: a cached node is owned only by the cache (refcount == 1). Thread A holds the lock and determines that the entry which should get cached equals the node (git_oid_cmp(&node->oid, &entry->oid) == 0). It frees the given entry to instead return the cached node to the user (entry = node). Now, before Thread A happens to increment the refcount of the node *outside* the cache lock, Thread B tries to store another entry and hits the slot of the node before, decrements its refcount and frees it *before* Thread A gets a chance to increment for the user. git_cached_obj_incref(entry); git_mutex_lock(&cache->lock); { git_cached_obj *node = cache->nodes[hash & cache->size_mask]; if (node == NULL) { cache->nodes[hash & cache->size_mask] = entry; } else if (git_oid_cmp(&node->oid, &entry->oid) == 0) { git_cached_obj_decref(entry, cache->free_obj); entry = node; } else { git_cached_obj_decref(node, cache->free_obj); // Thread B is here cache->nodes[hash & cache->size_mask] = entry; } } git_mutex_unlock(&cache->lock); // Thread A is here /* increase the refcount again, because we are * returning it to the user */ git_cached_obj_incref(entry);
Michael Schubert committed -
Fix logical error in git_index_set_caps
Russell Belfer committed -
git reference peel
Russell Belfer committed
-
- 10 Sep, 2012 3 commits
-
-
Often `git_odb_read_header` will "fail" and have to read the entire object into memory instead of just the header. When this happens, the object is loaded and then disposed of immediately, which makes it difficult to efficiently use the header information to decide if the object should be loaded (since attempting to do so will often result in loading the object twice). This commit takes the existing code and reorganizes it to have two new functions: - `git_odb__read_header_or_object` which acts just like the old read header function except that it returns the object, too, if it was forced to load the whole thing. It then becomes the callers responsibility to free the `git_odb_object`. - `git_object__from_odb_object` which was extracted from the old `git_object_lookup` and creates a subclass of `git_object` from an existing `git_odb_object` (separating the ODB lookup from the `git_object` creation). This allows you to use the first header reading function efficiently without instantiating the `git_odb_object` twice. There is no net change to the behavior of any of the existing functions, but this allows internal code to tap into the ODB lookup and object creation to be more efficient.
Russell Belfer committed -
This commit adds a max_size value in the public `git_diff_options` structure so that the user can automatically flag blobs over a certain size as binary regardless of other properties. Also, and perhaps more importantly, this moves binary detection to be as early as possible in the diff traversal inner loop and makes sure that we stop loading objects as soon as we decide that they are binary.
Russell Belfer committed -
The `git_diff_iterator_num_files` API was problematic, since we don't actually know the exact number of files to be iterated over until we load those files into memory. This replaces it with a new `git_diff_iterator_progress` API that goes from 0 to 1, and moves and renamed the old API for the internal places that can tolerate a max value instead of an exact value.
Russell Belfer committed
-
- 09 Sep, 2012 1 commit
-
-
Sascha Cunz committed
-
- 07 Sep, 2012 1 commit
-
-
When `git_submodule` became an opaque structure, I forgot to add accessor functions for the fetchRecurseSubmodules config setting. This fixes that.
Russell Belfer committed
-
- 06 Sep, 2012 5 commits
-
-
Previously when diffing blobs, the diff code just ran with a NULL repository object. Of course, that's not necessary and the test for a NULL repo was confusing. This makes the blob diff run with the repo that contains the blobs and clarifies the test that it is possible to be diffing data where the path is unknown.
Russell Belfer committed -
This adds support to diff and status for running filters (a la crlf) on blobs in the workdir before computing SHAs and before generating text diffs. This ended up being a bit more code change than I had thought since I had to reorganize some of the diff logic to minimize peak memory use when filtering blobs in a diff. This also adds a cap on the maximum size of data that will be loaded to diff. I set it at 512Mb which should match core git. Right now it is a #define in src/diff.h but it could be moved into the public API if desired.
Russell Belfer committed -
Russell Belfer committed
-
I couldn't get the last failing test to actually fail. This is a different test suggested by @nulltoken which should fail.
Russell Belfer committed -
Staged file status does not handle CRLF correctly. Ensures that the test repo has core.autocrlf=true for the test to fail.
pontusm committed
-