Commit Graph

3395 Commits

Author SHA1 Message Date
Sven Strickroth
f55af775ab Make clear that git_odb_hashfile does not use filters
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-09-22 01:16:10 +02:00
Russell Belfer
1a62810053 Make giterr_set_str public
There has been discussion for a while about making some set of
the `giterr_set` type functions part of the public API for code
that is implementing new backends to libgit2.  This makes the
`giterr_set_str()` and `giterr_set_oom()` functions public.
2012-09-21 15:04:39 -07:00
Russell Belfer
0cb24616ee Merge pull request #942 from nulltoken/topic/checkout-notify-skipped
checkout: add notification callback for skipped files
2012-09-21 10:51:42 -07:00
Russell Belfer
73f6da66af Merge pull request #943 from csware/only-close-open-filehandles
git_repository_hashfile: Only close file handle if we have a valid one
2012-09-21 10:42:53 -07:00
nulltoken
9e592583fc checkout: add notification callback for skipped files 2012-09-21 08:08:29 +02:00
Sven Strickroth
b1127a30c7 git_repository_hashfile: Only close file handle if we have a valid one
Otherwise this throws an exception on MFC based systems.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-09-20 22:32:19 +02:00
nulltoken
9ac8b113b1 Fix MSVC amd64 compilation warnings 2012-09-20 14:10:05 +02:00
nulltoken
28abf3dbd2 checkout: prefer mode_t type usage over int 2012-09-20 14:10:04 +02:00
Ben Straub
6340945186 ODB pack: snapshot last_found to avoid race
Also removed unnecessary refresh call and fixed
some indentation.
2012-09-19 04:55:16 -07:00
Ben Straub
78216495b0 Remove mtime checks from ODB packfile backend
Now forcing refresh on a foreach, and on missed full-oid
or short-oid lookups.
2012-09-19 04:41:30 -07:00
Ben Straub
5bb0dc9390 ODB: re-load packfiles on failed lookup
The old method was avoiding re-loading of packfiles by watching the mtime of the
pack directory. This causes the ODB to become stale if the directory and packfile
are written within the same clock millisecond, as when cloning a fairly small
repo.

This method tries to find the object in the cached packs, and forces a refresh when
that fails. This will cause extra stat'ing on a miss, but speeds up the success
case and avoids this race condition.
2012-09-19 04:41:24 -07:00
Philip Kelley
f08c60a518 Minor fixes for ignorecase support 2012-09-17 16:10:42 -04:00
Philip Kelley
ec40b7f99f Support for core.ignorecase 2012-09-17 15:42:41 -04:00
Russell Belfer
411cb017c2 Merge pull request #887 from nulltoken/topic/reset-hard
Checkout, reset and others enhancements
2012-09-17 11:38:33 -07:00
nulltoken
397837197d checkout: Mimic git_diff_options storage of paths 2012-09-17 20:27:28 +02:00
nulltoken
5e4cb4f4da checkout : reduce memory usage when not filtering 2012-09-17 10:48:36 +02:00
nulltoken
44af67a8b6 repository: introduce git_repository_set_head() 2012-09-17 10:48:35 +02:00
nulltoken
4ebe38bd58 repository: introduce git_repository_set_head_detached() 2012-09-17 10:48:35 +02:00
nulltoken
3f4c3072ea repository: introduce git_repository_detach_head() 2012-09-17 10:48:34 +02:00
nulltoken
cc548c7b0f repository: fix documentation typo 2012-09-17 10:48:33 +02:00
nulltoken
f1ad25f6df repository: separate head related tests 2012-09-17 10:48:32 +02:00
nulltoken
10df95c3ca checkout: add test coverage of dirs and subtrees 2012-09-17 10:48:31 +02:00
nulltoken
5af61863dd checkout: drop git_checkout_reference() 2012-09-17 10:48:30 +02:00
nulltoken
c214fa1caf checkout: segregate checkout strategies 2012-09-17 10:48:30 +02:00
nulltoken
020cda99c2 checkout: separate tree from index related tests 2012-09-17 10:48:29 +02:00
nulltoken
ee8bb8ba64 reset: add support for GIT_RESET_HARD mode 2012-09-17 10:48:28 +02:00
nulltoken
e93af30411 checkout: introduce git_checkout_index() 2012-09-17 10:48:27 +02:00
nulltoken
3aa443a951 checkout: introduce git_checkout_tree() 2012-09-17 10:48:26 +02:00
Carlos Martín Nieto
e8776d30f7 odb: don't overflow the link path buffer
Allocate a buffer large enough to store the path plus the terminator
instead of letting readlink write beyond the end.
2012-09-16 00:10:07 +02:00
Vicent Martí
1e90ae77c4 Merge pull request #860 from schu/thread-safety
odb_pack: make sure to search all backends
2012-09-14 13:45:29 -07:00
Michael Schubert
3d7617e49e odb_pack: fix race condition
last_found is the last packfile a wanted object was found in. Since
last_found is shared among all searching threads, it might changes while
we're searching. As suggested by @arrbee, put a copy on the stack to fix
the race condition.
2012-09-14 22:35:10 +02:00
Vicent Martí
70341b0963 Merge pull request #937 from nulltoken/fix/issue_936
refs: prevent locked refs from being enumerated
2012-09-14 13:33:49 -07:00
nulltoken
c2948c7754 refs: prevent locked refs from being enumerated
Fix #936
2012-09-14 21:56:14 +02:00
Carlos Martín Nieto
b200a813c0 config: fix Unicode BOM detection
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.
2012-09-14 20:46:34 +02:00
Russell Belfer
f4ea176fa8 Remove unnecessary include
I don't think clone.c needs in #include dirent.h and it is not
portable, so let's just get rid of it.
2012-09-14 10:31:40 -07:00
Russell Belfer
38760efb37 Merge pull request #934 from nulltoken/patch-1
Fix MSVC compilation warnings
2012-09-14 02:04:32 -07:00
nulltoken
7505022397 Fix MSVC compilation warnings 2012-09-14 11:47:43 +03:00
Vicent Martí
dfc50de260 Merge pull request #933 from barrbrain/pack-iterate-objects-in-offset-order
pack: iterate objects in offset order
2012-09-13 23:04:16 -07:00
David Michael Barr
60ecdf59d3 pack: iterate objects in offset order
Compute the ordering on demand and persist until the index is freed.
2012-09-14 15:52:41 +10:00
Carlos Martín Nieto
687ec68be4 http: use the new unicode functions
The winhttp branch was based on a version before these existed, so the
build broke on Windows.
2012-09-14 00:51:29 +02:00
Vicent Martí
db066a9655 Merge pull request #901 from carlosmn/winhttp
http: use WinHTTP on Windows
2012-09-13 17:24:08 -07:00
Carlos Martín Nieto
3ce22c7485 http: use WinHTTP on Windows
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.
2012-09-14 02:13:30 +02:00
Vicent Martí
57ad9f2e79 Merge pull request #931 from scunz/error_text
Fix error text s/buffer too long/buffer too short/
2012-09-13 14:35:41 -07:00
Sascha Cunz
13b554e376 Fix error text s/buffer too long/buffer too short/ 2012-09-13 23:30:31 +02:00
Vicent Martí
d973a5afd4 Merge pull request #929 from arrbee/diff-iter-fixes
Fix problems in diff iterator record chaining
2012-09-13 14:20:43 -07:00
Russell Belfer
12b6af1718 Forgot to reset hunk & line between files
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.
2012-09-13 14:15:07 -07:00
Vicent Martí
76bed9b2c2 Merge pull request #930 from nulltoken/fix/tracking-without-fetch-refspec
refspec: No remote tracking ref from a fetchspec-less remote
2012-09-13 13:35:04 -07:00
nulltoken
e16fc07f7e refspec: No remote tracking ref from a fetchspec-less remote 2012-09-13 22:31:29 +02:00
Russell Belfer
49d34c1c0c Fix problems in diff iterator record chaining
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.
2012-09-13 13:17:38 -07:00
Vicent Martí
9be2261eaa Merge pull request #927 from arrbee/hashfile-with-filters
Add git_repository_hashfile to hash with filters
2012-09-13 09:24:12 -07:00