Commit Graph

1589 Commits

Author SHA1 Message Date
Vicent Marti
72bdfdbc7c http-parser: Disable MSVC warnings locally 2011-09-29 15:25:22 +02:00
Carlos Martín Nieto
0812caaea5 Resync with upstream http-parser 2011-09-28 23:54:09 +02:00
Vicent Marti
5888860d2a msvc: Disable warnings in header file
Remove clutter from the CMakeLists file by disabling the warnings
programatically.
2011-09-28 23:49:55 +02:00
Vicent Marti
d215cf2429 http-parser: More type changes 2011-09-28 20:21:48 +02:00
Vicent Marti
59903b1fab Change types in http-parser 2011-09-28 19:41:33 +02:00
Vicent Marti
d02a7d8330 Update Clay 2011-09-28 18:57:32 +02:00
Vicent Martí
35e9407c46 Merge pull request #432 from carlosmn/msvc
Really fix MSVC
2011-09-27 11:14:23 -07:00
Carlos Martín Nieto
a5b0e7f8bc Really fix MSVC
These was left over from the previous PRs.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-27 20:08:15 +02:00
Carlos Martín Nieto
887eaf4dc9 Fix dev branch under MSVC
In libgit2: Move an enum out of an int bitfield in the HTTP transport.

In the parser: Use int bitfields and change some variable sizes to
better fit thir use. Variables that count the size of the data chunk
can only ever be as large as off_t. Warning 4127 can be ignored, as
nobody takes it seriously anyway.

From Emeric: change some variable declarations to keep MSVC happy.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-27 15:02:36 +02:00
Vicent Marti
dc5c87812c http-parser: Do not use bitfields
Bitfields suck. And if you make them with non-int types, they suck
in a non-standards compliant way. Like sucking sideways or something.

This commit removes all bitfields in the `http_parser` struct, and
replaces them with the minimal type needed to contain their values. Note
that the fields in the struct have been reordered so they can be packed
with 4-byte alignment.

This saves both memory on the parser (because non-int bitfields get expanded to
4byte in most compilers anyway) and time (because the fields are now
properly aligned and the compiler doesn't need to generate bit-level ops
to access them).
2011-09-27 14:59:34 +02:00
Carlos Martín Nieto
40fe5fbea8 Make repo config loading automatic or completely explicit
git_repository_config wants to take the global and system paths again
so that one can be explicit if needed.

The git_repository_config_autoload function is provided for the cases
when it's good enough for the library to guess where those files are
located.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-27 14:40:56 +02:00
Carlos Martín Nieto
4c562347ae Add git_config_find_system
This allows the library to guess where the system configuration file
should be located.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-27 14:39:38 +02:00
Vicent Martí
5911639235 Merge pull request #427 from schu/fix-unused-parameters
t18-status.c: fix unused warnings
2011-09-27 05:35:34 -07:00
Vicent Marti
8e9bfa4cf0 tree: Fix check for valid attributes 2011-09-27 14:33:19 +02:00
Vicent Marti
9ef9e8c3ad tree: Use an internal append functiont to add new entries 2011-09-27 14:33:18 +02:00
Carlos Martín Nieto
8255c69b10 Make use of the tree cache
Taking advantage of the tree cache, git_tree_create_fromindex becomes
comparable in speed to git write-tree when the cache is available.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-27 14:33:18 +02:00
Carlos Martín Nieto
3ba69ba8a4 Add git_tree_cache_get
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-09-27 14:33:18 +02:00
Carlos Martín Nieto
b419fe2d8c Invalidate the path when removing from the index
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-09-27 14:33:18 +02:00
Carlos Martín Nieto
e23ede0de5 index: invalidate added paths
When a file is updated in the index, it's path needs to be invalidated
in the tree cache as the hash is no longer correct.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-09-27 14:33:18 +02:00
Carlos Martín Nieto
69bffab969 Add git_tree_cache_invalidate_path
Whenever a file is updated in the index, each tree leading towards it
needs to be invalidated. Provide the supporting function.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-09-27 14:33:18 +02:00
Carlos Martín Nieto
acd31b4ad6 tree cache: correctly handle invalidated trees
The fix introduced in a02fc2cd1 (2011-05-24; index: correctly parse
invalidated TREE extensions) threw out the rest of the data in the
extension if it found an invalidated entry. This was the result of
incorrect reading of the documentation.

Insted, keep reading the extension, as there may be cached data we can
use.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-09-27 14:33:18 +02:00
Carlos Martín Nieto
b183ffe77e Make tree cache name a flex-array
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-09-27 14:33:18 +02:00
Carlos Martín Nieto
b41713206b Move the tree cache functions to their own file
Rename git_index_tree to git_tree_cache.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-09-27 14:33:18 +02:00
Vicent Marti
01d7fded1b Revert "Rewrite getenv to use Win32 version on Windows"
This reverts commit e1b8644467.
2011-09-27 14:33:18 +02:00
Vicent Martí
ea4dad8ec4 Merge pull request #424 from carlosmn/access-unicode
Implment p_access and use it in git_fileutils_exists
2011-09-25 06:52:01 -07:00
schu
ddeaa7fb68 t18-status.c: fix unused warnings
Signed-off-by: schu <schu-github@schulog.org>
2011-09-24 13:41:10 +02:00
Carlos Martín Nieto
dd44887ac6 Implment p_access and use it in git_fileutils_exists
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-23 00:00:05 +02:00
Paul Betts
76c15b7191 Revert changes to clay 2011-09-22 12:26:23 -07:00
Vicent Martí
01ab592b82 Merge pull request #421 from nulltoken/ntk/fix/config-get-set-long
config: make git_config_[get|set]_long() able to properly deal with 8 bytes wide values
2011-09-22 10:28:05 -07:00
Vicent Marti
87a26ad55e Add HTTP sources to Clay suite 2011-09-22 20:23:42 +03:00
Vicent Martí
8114ee4c95 Merge pull request #405 from carlosmn/http-ls
Implement ls-remote over HTTP
2011-09-22 10:17:43 -07:00
nulltoken
ad196c6ae6 config: make git_config_[get|set]_long() able to properly deal with 8 bytes wide values
Should fix issue #419.

Signed-off-by: nulltoken <emeric.fermas@gmail.com>
2011-09-22 18:58:47 +02:00
Carlos Martín Nieto
4ee8418a08 http: get rid of the global state
Move the header parsing state into the transport, making use of the
existing bitfield.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-21 22:14:09 +02:00
Paul Betts
e1b8644467 Rewrite getenv to use Win32 version on Windows 2011-09-21 12:00:34 -07:00
Vicent Marti
e3ecf7e9ab Do not have duplicate filenames
Two `posix.c` files may or may not break MSVC builds under 2008. Do not
have repeated objects.

You will need to clean & regenerate CMake.
2011-09-21 14:09:56 +03:00
Vicent Martí
805dc2a088 Merge pull request #415 from schu/ref-rename-regression
refs: fix git_reference_rename()
2011-09-20 15:52:16 -07:00
Vicent Martí
4e52d34026 Merge pull request #413 from libgit2/utf8-paths-win32
Rewrite p_* functions to use Unicode and marshal to UTF8 internally, take 2
2011-09-20 15:38:10 -07:00
Vicent Martí
b6dcc2ebc9 Merge pull request #414 from carlosmn/repo-discover-short
repsitory: use better error code if path is too short for discover
2011-09-20 15:37:55 -07:00
Vicent Marti
a58881274d Fix clay under MinGW 2011-09-21 01:14:57 +03:00
Vicent Marti
9457a36ca0 Merge branch 'development' of github.com:libgit2/libgit2 into development 2011-09-21 01:10:11 +03:00
schu
93fdbe000c refs: fix git_reference_rename()
reference_rename() recently failed when renaming an existing reference
refs/heads/foo/bar -> refs/heads/foo because of a change in the
underlying functions / error codes. Fixes #412.

Signed-off-by: schu <schu-github@schulog.org>
2011-09-20 11:56:21 +02:00
schu
b4ec3c648f refs: add additional test for reference renaming
Signed-off-by: nulltoken <emeric.fermas@gmail.com>
Signed-off-by: schu <schu-github@schulog.org>
2011-09-20 11:26:08 +02:00
Carlos Martín Nieto
c3fe018b12 repsitory: use better error code if path is too short for discover
GIT_EOVERFLOW means something different. Use GIT_ESHORTBUFFER. On the
way, remove a redundant sizeof(char).

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-09-20 10:02:11 +02:00
Paul Betts
6d0ef97478 Fix opendir/readdir and friends on Win32 to use Unicode 2011-09-19 13:14:09 -07:00
Paul Betts
7998ae5ab1 Rewrite p_* functions to use Unicode and marshal to UTF8 internally 2011-09-19 13:14:04 -07:00
Paul Betts
c498701df7 Fix tests to use portable setenv 2011-09-19 10:38:44 -07:00
Paul Betts
222d057c22 Create cross-platform setenv 2011-09-19 10:34:52 -07:00
Vicent Marti
468d0d1e1e Fix repository_config call in network::remotes 2011-09-19 06:32:56 +03:00
Vicent Marti
19d869bb2e Fix warning in status.c 2011-09-19 06:31:54 +03:00
Carlos Martín Nieto
3a2626f32a Add remotes test to clay
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-19 06:17:28 +03:00