1. 17 Sep, 2012 7 commits
  2. 15 Sep, 2012 1 commit
  3. 14 Sep, 2012 10 commits
  4. 13 Sep, 2012 1 commit
  5. 14 Sep, 2012 2 commits
  6. 13 Sep, 2012 10 commits
  7. 12 Sep, 2012 2 commits
    • odb_pack: try lookup before refreshing packs · ab8a0402
      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
    • Add tests and improve param checks · a13fb55a
      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
  8. 11 Sep, 2012 7 commits
    • Add git_repository_hashfile to hash with filters · 47bfa0be
      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
    • Merge pull request #920 from scunz/mergebase_const · 21d847d3
      git_mergebase: Constness-Fix for consistency
      Vicent Martí committed
    • Properly handle p_reads · c859184b
      Vicent Marti committed
    • Fix diff binary file detection · 1f35e89d
      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
    • Merge pull request #924 from schu/cache-fix-race-cond · 5a409c44
      cache: fix race condition
      Vicent Martí committed
    • cache: fix race condition · 6ee68611
      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