Commit Graph

7065 Commits

Author SHA1 Message Date
Carlos Martín Nieto
b3d3459f32 pack: return the correct final offset
The callers of git_packfile_unpack() expect the obj_offset argument to
be set to the beginning of the next object. We were mistakenly returning
the the offset of the object's data, which causes the CRC function to
try to use the wrong offset.

Set obj_offset to curpos instead of elem->offset to point to the next
element and bring back expected behaviour.
2014-08-26 15:09:47 +02:00
Vicent Marti
844d226c9d Merge pull request #2532 from arthurschreiber/arthur/fix-merge-base-commit-check
merge base: Correctly raise an error if a non-commit object is passed.
2014-08-25 23:06:34 +02:00
Arthur Schreiber
017c0eac2b merge base: Correctly raise an error if a non-commit object is passed. 2014-08-25 22:41:07 +02:00
Vicent Marti
5af52c628b Merge pull request #2531 from libgit2/rb/mkdir-allow-parent-failures
Allow mkdir helper to skip parent errors
2014-08-25 21:04:09 +02:00
Vicent Marti
2c1de697e0 Merge pull request #2527 from jacquesg/refspec-crash
Check if the refspec matches before transforming
2014-08-25 18:18:06 +02:00
Russell Belfer
668ae2ddf8 Allow mkdir helper to skip parent errors
Our mkdir helper was failing is a parent directory was not
accessible even if the child directory could be created.
This changes the helper to keep trying child directories
even when the parent is unwritable.
2014-08-22 10:05:09 -07:00
Jacques Germishuys
8f6073f63e Check that the refspec matches before modifying the out buffer 2014-08-21 18:53:43 +02:00
Vicent Marti
d28b2b7a5f Merge pull request #2528 from libgit2/vmg/tostr_s
Export `git_oid_tostr_s` instead of `_allocfmt`
2014-08-18 15:18:59 +02:00
Vicent Marti
43ebca8d7b Revert "test: Remove symlinks from the source tree"
This reverts commit 0dc54e1494.
2014-08-18 15:18:47 +02:00
Vicent Marti
0dc54e1494 test: Remove symlinks from the source tree
We don't really use this at all, and it breaks packaging in Windows.
2014-08-18 12:47:16 +02:00
Vicent Marti
4ca0b566ca oid: Export git_oid_tostr_s instead of _allocfmt
The old `allocfmt` is of no use to callers, as they are not able to free
the returned buffer. Export a new API that returns a static string that
doesn't need to be freed.
2014-08-18 12:41:06 +02:00
Vicent Marti
414dbe9633 Merge pull request #2525 from libgit2/cmn/http-recv-buffer
http: make sure we can consume the data we request
2014-08-18 12:26:18 +02:00
Vicent Marti
1a85eca037 Merge pull request #2523 from leighlondon/remove-completed-project
Removing a completed starter project.
2014-08-18 12:25:50 +02:00
Jacques Germishuys
4e53c28096 Check if the refspec matches before transforming 2014-08-17 14:55:06 +02:00
Carlos Martín Nieto
294c6f2964 http: make sure we can consume the data we request
The recv buffer (parse_buffer) and the buffer have independent sizes and
offsets. We try to fill in parse_buffer as much as possible before
passing it to the http parser. This is fine most of the time, but fails
us when the buffer is almost full.

In those situations, parse_buffer can have more data than we would be
able to put into the buffer (which may be getting full if we're towards
the end of a data sideband packet).

To work around this, we check if the space we have left on our buffer is
smaller than what could come from the network. If this happens, we make
parse_buffer think that it has as much space left as our buffer, so it
won't try to retrieve more data than we can deal with.

As the start of the data may no longer be at the start of the buffer, we
need to keep track of where it really starts (data_offset) and use that
in our calculations for the real size of the data we received from the
network.

This fixes #2518.
2014-08-16 22:21:12 +02:00
Leigh London
1f2f611465 Removing a completed starter project.
Removing the starter project for adding support for the symref
extension (#2006) from PROJECTS.md, as this seems to have been
completed with the merge of #2376.
2014-08-16 19:13:21 +10:00
Vicent Marti
fa44a1699c Merge pull request #2521 from jacquesg/remote-ls-not-connected
git_remote_ls() crashes before connect is called
2014-08-15 23:10:45 +02:00
Jacques Germishuys
dc8adda4f1 git_remote_ls() should return an error if the transport is not available 2014-08-15 22:56:15 +02:00
Vicent Marti
e1c4429038 Merge pull request #2497 from ethomson/kerberos3
SPNEGO authentication via GSSAPI
2014-08-15 20:33:38 +02:00
Edward Thomson
23135afa6f Introduce proper http authentication API 2014-08-15 14:11:56 -04:00
Edward Thomson
315cb38e1e Add GSSAPI support for SPNEGO/Kerberos auth over HTTP 2014-08-15 11:12:42 -04:00
Edward Thomson
e003f83a58 Introduce git_buf_decode_base64
Decode base64-encoded text into a git_buf
2014-08-15 11:12:42 -04:00
Edward Thomson
40867266bf Perform HTTP keep-alive 2014-08-15 11:12:42 -04:00
Edward Thomson
adcdeb36b0 online::clone::credentials support default credentials 2014-08-15 11:12:42 -04:00
Edward Thomson
f96e7e6c94 Free references during push validation 2014-08-15 11:12:42 -04:00
Edward Thomson
0f29e96793 Remove the refs/notes/commits that we push in test
The online::push::notes test pushes a note but leaves it hanging
around for other tests to stumble across when they're validating
that they're seeing the refs they expect to see.  Clean it up on
exit.
2014-08-14 10:18:21 -05:00
Edward Thomson
aea676336c Don't run the ssh clone tests against http remotes 2014-08-14 10:18:20 -05:00
Vicent Marti
fb48a51c63 Merge pull request #2469 from ethomson/transport2
Custom transport: minor cleanups
2014-08-14 17:01:02 +02:00
Edward Thomson
c180c06586 Custom transport: minor cleanups
* Move the transport registration mechanisms into a new header under
   'sys/' because this is advanced stuff.
 * Remove the 'priority' argument from the registration as it adds
   unnecessary complexity.  (Since transports cannot decline to operate,
   only the highest priority transport is ever executed.)  Users who
   require per-priority transports can implement that in their custom
   transport themselves.
 * Simplify registration further by taking a scheme (eg "http") instead
   of a prefix (eg "http://").
2014-08-14 08:52:20 -05:00
Vicent Marti
49d5ec7137 Merge pull request #2517 from ethomson/no_win_unreadable
Don't include the unreadable tests on win32
2014-08-13 23:38:53 +02:00
Edward Thomson
c8402334d2 Don't include the unreadable tests on win32 2014-08-13 17:23:07 -04:00
Vicent Marti
0707feee37 Merge pull request #2513 from ethomson/giterr_null_msg
Allow NULL error message prefix when class=GITERR_OS
2014-08-13 21:23:23 +02:00
Edward Thomson
e62f96dea5 Allow NULL error message prefix when class=GITERR_OS 2014-08-13 14:55:24 -04:00
Vicent Marti
59403f1ff5 Merge pull request #2509 from libgit2/cmn/immediate-multiline
config: a multiline var can start immediately
2014-08-09 12:24:02 +02:00
Carlos Martín Nieto
9dac1f9579 config: a multiline var can start immediately
In the check for multiline, we traverse the backslashes from the end
backwards and int the end assert that we haven't gone past the beginning
of the line. We make sure of this in the loop condition, but we also
check in the return value.

However, for certain configurations, a line in a multiline variable
might be empty to aid formatting. In that case, 'end' == 'start', since
we ended up looking at the first char which made it a multiline.

There is no need for the (end > start) check in the return, since the
loop guarantees we won't go further back than the first char in the
line, and we do accept the first char to be the final backslash.

This fixes #2483.
2014-08-09 11:06:49 +02:00
Vicent Marti
bb9e6028b8 Merge pull request #2507 from libgit2/rb/timer-typo
Typo in timer constants
2014-08-09 00:35:08 +02:00
Vicent Marti
35f186b6ca Merge pull request #2506 from libgit2/rb/ignore-pipes-etc
Don't report status on named pipes
2014-08-08 22:28:27 +02:00
Russell Belfer
f18234fad6 Don't report status on named pipes
Git skips entries in directories that are not S_ISDIR, S_ISREG, or
S_ISLNK, so let's make libgit2 do the same thing.
2014-08-08 13:17:50 -07:00
Vicent Marti
8f759ac0b3 Merge pull request #2471 from jacquesg/compatibility-cleanup
Compatibility/Portability cleanup
2014-08-07 18:00:57 +02:00
Russell Belfer
3822d2cc4f Fix typo in timer normalization constants
The effect of this would be that various update callbacks would
not be made at the correct interval.
2014-08-05 15:06:45 -07:00
Jacques Germishuys
07d03d3145 Introduce some consistency in definition/declaration ordering 2014-08-05 20:52:00 +02:00
Jacques Germishuys
662f90e6ec Move p_realpath logic to realpath.c 2014-08-05 20:52:00 +02:00
Jacques Germishuys
c7dd0a56bf Use p_snprintf also in tests 2014-08-05 20:51:59 +02:00
Jacques Germishuys
c983604eb1 Consistently use p_snprintf 2014-08-05 20:51:59 +02:00
Jacques Germishuys
2f795d8fc5 Cleanup portability/compatibility layer
* Removes mingw-compat.h
* Cleans up separation of compiler/platform idiosyncrasies
* Unifies mingw/msvc stat structures and functions
* (Tries to) hide more compiler specific implementation details (even in our internal API)
2014-08-05 20:51:59 +02:00
Jacques Germishuys
d07fd4425f Define WINHTTP_IGNORE_REQUEST_TOTAL_LENGTH if not defined 2014-08-05 20:51:59 +02:00
Jacques Germishuys
959a93e716 Silence unused variables warnings 2014-08-05 20:51:59 +02:00
Vicent Marti
e0af2517bf Merge pull request #2503 from jacquesg/solaris-http-parser
Solaris doesn't necessarily have stdint.h, use inttypes.h
2014-08-05 20:28:22 +02:00
Jacques Germishuys
66d1595436 Solaris doesn't necessarily have stdint.h, use inttypes.h 2014-08-05 19:51:29 +02:00
Vicent Marti
59e3f45b61 Merge pull request #2487 from libgit2/cmn/revwalk-no-prealloc
Work around strict aliasing in array growth
2014-07-25 11:27:51 +02:00