Commit Graph

5117 Commits

Author SHA1 Message Date
Russell Belfer
999d4405a6 Simplify git_futils_mkdir
This routine was (is) pretty complicated, but given the recent
changes, it seemed like it could be simplified a bit.
2013-06-05 12:02:28 -07:00
Vicent Marti
2e1fa15fcd I'm a dick 2013-06-05 19:00:16 +02:00
Vicent Martí
987ab76580 Merge pull request #1634 from arrbee/alternative-mkdir-fix
Ensure git_futils_mkdir won't mkdir root
2013-06-05 09:57:59 -07:00
Russell Belfer
b832ecf71c Ensure git_futils_mkdir won't mkdir root
This makes sure that git_futils_mkdir always skips over the root
directory at a minimum, even on platforms where the root is not
simply '/'.  Also, this removes the GIT_WIN32 ifdef in favor of
making EACCES as a potentially recoverable error on all platforms.
2013-06-05 09:46:51 -07:00
Vicent Martí
e236b37ff7 Merge pull request #1633 from jamill/directory_create_fix
Allow creation of directories under the volume root in Win32
2013-06-05 09:16:19 -07:00
Jameson Miller
daf98cb2ed Allow creation of directories under the volume root in Win32
We ran into an issue where cloning a repository to a folder
directly underneath the root of a volume (e.g. 'd:\libgit2')
would fail with an access denied error. This was traced down
to a call to make a directory that is the root (e.g. 'd:') could
return an error indicated access denied instead of an error
indicating the path already exists. This change now handles
the access denied error on Win32 and checks for the existence
of the folder.
2013-06-05 12:05:29 -04:00
Vicent Martí
947fad4f7f Merge pull request #1624 from libgit2/vmg/full-ref-iterator
Breaking RefDB changes
2013-06-03 09:28:58 -07:00
Scott J. Goldman
9d9fff3c3d Merge pull request #1631 from scottjg/fix-timezone-parsing
Don't bail on parsing commits with an invalid timezone
2013-06-02 02:16:05 -07:00
Scott J. Goldman
dc33b3d7b2 Don't bail on parsing commits with an invalid timezone
git doesn't do that, and it's not something that's usually
actionable to fix. if you have a git repository with one bad
timezone in the history, it's too late to change it most likely.
2013-06-02 02:13:45 -07:00
Vicent Martí
cfbd08a59c Merge pull request #1630 from arrbee/index-read-tree-preserve-stat-cache
Make git_index_read_tree preserve stat cache where possible
2013-06-01 04:28:24 -07:00
Russell Belfer
03a8907078 Make git_index_read_tree preserve stat cache
Instead of just blowing away the stat cache data when loading a
new tree into the index, this checks if each loaded item has a
corresponding existing item with the same OID and if so, copies
the stat data from the old item to the new one so it will not be
blown away.
2013-05-31 21:49:40 -07:00
Vicent Martí
efd5a4e16a Merge pull request #1627 from arrbee/iterator-api-improvements
Make iterators use GIT_ITEROVER & smart advance
2013-05-31 14:36:08 -07:00
Russell Belfer
1a42dd17eb Mutex init can fail
It is obviously quite a serious problem if this happens, but mutex
initialization can fail and we should detect it.  It's a bit like
a memory allocation failure, in that you're probably pretty screwed
if this occurs, but at least we'll catch it.
2013-05-31 14:13:11 -07:00
Russell Belfer
f658dc433c Zero memory for major objects before freeing
By zeroing out the memory when we free larger objects (i.e. those
that serve as collections of other data, such as repos, odb, refdb),
I'm hoping that it will be easier for libgit2 bindings to find
errors in their object management code.
2013-05-31 14:09:58 -07:00
Russell Belfer
cee695ae6b Make iterators use GIT_ITEROVER & smart advance
1. internal iterators now return GIT_ITEROVER when you go past the
   last item in the iteration.
2. git_iterator_advance will "advance" to the first item in the
   iteration if it is called immediately after creating the
   iterator, which allows a simpler idiom for basic iteration.
3. if git_iterator_advance encounters an error reading data (e.g.
   a missing tree or an unreadable file), it returns the error
   but also attempts to advance past the invalid data to prevent
   an infinite loop.

Updated all tests and internal usage of iterators to account for
these new behaviors.
2013-05-31 12:18:43 -07:00
Vicent Martí
17ef7dbce4 Merge pull request #1626 from ethomson/index_ext_truncation
improve test for index extension truncation
2013-05-31 09:51:53 -07:00
Edward Thomson
8c2458bea6 improve test for index extension truncation 2013-05-31 11:41:33 -05:00
Vicent Martí
8d863aa205 Merge pull request #1621 from NHDaly/clone_transport_flags
Added support for setting transport flags (No check SSL cert) to git_clo...
2013-05-31 06:01:59 -07:00
Nathan Daly
883929144d Added support for setting transport flags (No check SSL cert) to git_clone call. 2013-05-31 08:53:22 -04:00
Vicent Martí
9afc59710e Merge pull request #1559 from carlosmn/ref-shorthand
Introduce git_reference_shorthand
2013-05-31 03:09:38 -07:00
Vicent Martí
af2c72d228 Merge pull request #1623 from yorah/fix/tag_auto
remote: make default tag retrieving behaviour consistent
2013-05-31 03:08:48 -07:00
Vicent Martí
9d6d809b7f Merge pull request #1530 from veeti/http-parser
Build with the system's http-parser installation if available
2013-05-31 03:06:07 -07:00
Vicent Marti
1ed356dcfe Frees 2013-05-30 21:04:28 +02:00
Veeti Paananen
7a6e0281c6 Build with the system's http-parser installation if available 2013-05-30 21:14:05 +03:00
yorah
df50512aeb Proposal to handle default value (auto = 0) 2013-05-30 18:06:54 +02:00
yorah
215af2ccb8 remote: make default tag retrieving behaviour consistent
Default for newly created remotes will be auto.
Default when loading existing remotes with no tag retrieving behaviour set, was already auto.
2013-05-30 17:59:11 +02:00
Ben Straub
b2984e8aac Merge pull request #1622 from yorah/fix/thread-segfault
thread: fix segfault on Windows 64 bits
2013-05-30 08:43:14 -07:00
Vicent Marti
979f75d8e1 Refcounting 2013-05-30 17:19:43 +02:00
yorah
d17db2fd77 thread: fix segfault on Windows 64 bits
`lpExitCode` is a pointer to a long. A long is 32 bits wide on Windows.

It means that on Windows 64bits, `GetExitCodeThread()` doesn't set/clear the high-order bytes of the 64 bits memory space pointed at by `value_ptr`.
2013-05-30 11:45:11 +02:00
Vicent Marti
4e6e2ff26f ...Aaaand this works 2013-05-30 03:47:10 +02:00
Russell Belfer
0c01f93e8c Merge pull request #1619 from ethomson/gitignore_slash
allow (ignore) bare slash in gitignore
2013-05-29 14:50:24 -07:00
Edward Thomson
2d160ef782 allow (ignore) bare slash in gitignore 2013-05-29 16:26:25 -05:00
Vicent Marti
ec24e54296 What are the chances, really 2013-05-29 22:47:37 +02:00
Vicent Martí
17776314c8 Merge pull request #1617 from arrbee/fix-oid-memory-leak
Fix memory leak in oid shortener tests
2013-05-29 09:55:51 -07:00
Russell Belfer
ca9b1702ab Fix memory leak in oid shortener tests 2013-05-29 09:18:21 -07:00
Edward Thomson
504a4fd140 Merge pull request #1615 from arthurschreiber/patch-1
Fix two typos in the merge docs.
2013-05-28 14:12:55 -07:00
Arthur Schreiber
31a6118175 Fix two typos in the merge docs. 2013-05-29 00:02:26 +03:00
Vicent Marti
56960b8396 Liike this 2013-05-28 20:47:55 +02:00
Vicent Marti
2638a03aff This refs iterator pleases the gods. 2013-05-28 17:50:47 +02:00
Russell Belfer
9007c53fae Fixing unwrapped calloc 2013-05-27 16:45:22 -07:00
Vicent Martí
8baca134cc Merge pull request #1614 from schu/packbuilder-write
packbuilder: also write index in git_packbuilder_write
2013-05-27 06:15:28 -07:00
Michael Schubert
563c19a9ce packbuilder: also write index in git_packbuilder_write
git_packbuilder_write() used to write a packfile to the passed file
path. Instead, ask for a destination directory and create both the
packfile and an index, as most users probably do expect.
2013-05-27 13:41:09 +02:00
Vicent Martí
63908cee27 Merge pull request #1613 from schu/transport-ssh
tests: don't verify SSH unsupported with GIT_SSH
2013-05-27 03:24:52 -07:00
Michael Schubert
0582ae6fde tests: don't verify SSH unsupported with GIT_SSH 2013-05-27 12:12:27 +02:00
Russell Belfer
5aee96329a Merge pull request #1612 from drodriguez/fix-branch-delete-docs
Fix documentation of git_branch_delete.
2013-05-26 08:45:30 -07:00
Daniel Rodríguez Troitiño
f8bd730cd9 Fix documentation of git_branch_delete.
The reference should be freed by the user, not the library.
2013-05-26 17:29:00 +02:00
Vicent Martí
0d77647adc Merge pull request #1609 from ethomson/qsort_r_glibc
qsort_r appeared in glibc 2.8
2013-05-25 09:45:02 -07:00
Edward Thomson
c37fb41ae0 qsort_r appeared in glibc 2.8 2013-05-25 12:35:55 -04:00
Vicent Martí
85281328be Merge pull request #1608 from arrbee/various-cleanups-and-tweaks
Various cleanups and tweaks
2013-05-24 11:39:56 -07:00
Russell Belfer
7a5ee3dc92 Add ~ expansion to global attributes and excludes
This adds ~/ prefix expansion for the value of core.attributesfile
and core.excludesfile, plus it fixes the fact that the attributes
cache was holding on to the string data from the config for a long
time (instead of making its own strdup) which could have caused a
problem if the config was refreshed.  Adds a test for the new
expansion capability.
2013-05-24 11:09:04 -07:00