Commit Graph

1650 Commits

Author SHA1 Message Date
Carlos Martín Nieto
f9d4b0c395 git_repository_config: open global config file automatically
If the global configuration file is missing, it is ignored.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-12 17:25:46 +02:00
Carlos Martín Nieto
7e08191a06 http: also store Content-Type if it's the last field
When Content-Type is the last field, we only know when we can store it
when we reach on_headers_complete.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-12 17:04:17 +02:00
Carlos Martín Nieto
5604f92880 http: store which service to expect
Depending on what we want to do, we expect the Content-Type field to
have different contents. Store which service to expect instead of
hard-coding the string.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-12 17:04:17 +02:00
Carlos Martín Nieto
1b76290089 Implement ls-remote over smart HTTP
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-12 17:04:17 +02:00
Jerome Lambourg
22c3046462 Fix compilation issues with ming64 headers 2011-09-12 11:06:54 +02:00
Carlos Martín Nieto
4a619797ec tree: use git_treebuilder to write the index as a tree
There is no point in reinventing the wheel when using the treebuilder
is much more straightforward and makes the code more readable. There
is no optimisation, and the performance is no worse than when writing
the tree object ourselves.
2011-09-10 02:05:38 +02:00
schu
c8f16bfef9 filebuf.c: fix unused-but-set warning
write_deflate() used to ignore errors by zlib's deflate function when
not compiling in DEBUG mode. Always read $result and throw an error
instead.

Signed-off-by: schu <schu-github@schulog.org>
2011-09-09 16:59:28 +02:00
Carlos Martín Nieto
928dd90ae8 netops: store the error if gitno_send fails
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-09 13:17:58 +02:00
Carlos Martín Nieto
b8a8191fed http: add http-parser
The code is under the MIT lincense

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-09 13:12:12 +02:00
Carlos Martín Nieto
24384700d2 netops: don't try to free addrinfo on DNS error
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-09 13:12:11 +02:00
Carlos Martín Nieto
b76f752279 pkt: add the comment type
This is needed for smart HTTP

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-09 13:12:11 +02:00
Carlos Martín Nieto
c7c3051328 buffer: add git_buf_consume
Moves the content after 'end' to the beginning of the buffer

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-09 13:12:11 +02:00
Carlos Martín Nieto
b87600cb6b buffer: add git_buf_clear
Set the size to zero so the memory that has already been allocated
can be reused

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-09 13:12:11 +02:00
Carlos Martín Nieto
b0bda0a4ee netops: get rid of the len - 1 limitation
This was as a result of the pkt code using string functions where
they shouldn't.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-09 13:12:11 +02:00
Vicent Martí
3f3f6225f8 Merge pull request #391 from sschuberth/development
Warning fixes
2011-09-08 14:20:19 -07:00
Sebastian Schuberth
bac47f1ff8 Add myself to the list of Git authors who consent 2011-09-08 17:13:32 +02:00
Sebastian Schuberth
18136d8306 Fix an integral overflow on 64-bit 2011-09-08 17:09:10 +02:00
Sebastian Schuberth
1c3fac4d5e Add casts to get rid of some warnings when filling zlib structures 2011-09-08 17:08:57 +02:00
Sebastian Schuberth
353560b440 Get rid of a superfluous pointer cast 2011-09-08 17:08:10 +02:00
Sebastian Schuberth
45e93ef34e Fix minor indentation issues (spaces to tabs) 2011-09-08 17:07:52 +02:00
Sebastian Schuberth
26e74c6ace Fix some random size_t vs. int conversion warnings 2011-09-08 17:07:37 +02:00
Carlos Martín Nieto
76a9081db2 pkt: don't use strlen before we know the name is NUL-terminated
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-07 16:37:19 +02:00
Carlos Martín Nieto
db84b7988b Move extract_host_and_port to netops and add default port argument
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-04 16:07:52 +02:00
Carlos Martín Nieto
3d975abcb8 Add HTTP transport skeleton
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-04 16:04:14 +02:00
Vicent Martí
564f0f7be1 Merge pull request #388 from lambourg/master
pull request for #387
2011-09-02 06:08:47 -07:00
Jerome Lambourg
13bc2016b7 Fix for issue #387 2011-09-02 13:04:29 +02:00
Vicent Marti
c035ede234 Fix compilation in MinGW 2011-08-31 03:56:57 +02:00
Kirill A. Shutemov
d568d5856b CMakefile: add -Wmissing-prototypes and fix warnings
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-08-30 23:55:22 +03:00
Kirill A. Shutemov
51d0044629 CMakefile: add -Wstrict-prototypes and fix warnings
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-08-30 23:33:59 +03:00
Kirill A. Shutemov
0b2c406187 CMakefile: add -Wstrict-aliasing=2 and fix warnings
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-08-30 23:06:04 +03:00
Vicent Marti
2fcf9c8273 posix: Fix undeclared prototype 2011-08-30 11:32:33 -07:00
Vicent Marti
6f1d23b29f repository: Fix signed/unsigned comp. 2011-08-30 11:27:36 -07:00
Vicent Marti
92e34fa6d6 netops: This is the proper check 2011-08-30 19:48:13 +02:00
Vicent Martí
b298e03b16 Merge pull request #380 from kiryl/no-release-debug
CMakeLists: no need in split debug/release build
2011-08-30 10:46:40 -07:00
Vicent Marti
0bd594b61c netops: Use the size_t, Luke 2011-08-30 19:44:09 +02:00
Carlos Martín Nieto
778e1c739b Add git_remote_new
As we no longer expose the transport functions, this is now the only
way to connect to a remote when given an URL instead of a remote name

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-30 19:37:14 +02:00
Carlos Martín Nieto
b5a8aa94bf Don't hide the transport details
Transports shouldn't get used outside of the library, so don't expose
accessor functions.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-30 19:37:14 +02:00
Carlos Martín Nieto
74bd343ae8 Fix Windows compilation
Sockets on Windows are unsigned, so define a type GIT_SOCKET which is
signed or unsigned depending on the platform.

Thanks to Em for his patience with this.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-30 19:37:14 +02:00
Vicent Marti
f978b748bb compat: Move mkstemp to the POSIX compat layer 2011-08-30 13:34:14 +02:00
Vicent Marti
3ef7d06302 network: <select.h> is not available in MinGW 2011-08-30 13:10:47 +02:00
Vicent Martí
aa2f68d807 Merge pull request #378 from kiryl/Wuninitialized
Wuninitialized
2011-08-30 03:39:28 -07:00
Vicent Martí
420cbdc24d Merge pull request #379 from kiryl/STRLEN
Drop STRLEN() macros
2011-08-25 20:42:03 -07:00
Kirill A. Shutemov
85b9165201 pkt: use sizeof() instead of strlen() to avoid variable length array
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-08-26 00:02:06 +03:00
Kirill A. Shutemov
932669b865 Drop STRLEN() macros
There is no need in STRLEN macros. Compilers can do this trivial
optimization on its own.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-08-25 16:41:15 +03:00
Kirill A. Shutemov
0d5aa7d7b8 CMakeLists: no need in split debug/release build
With GNU toolchain there's no need to split debug/release build.

It's useful to have -O2 in debug envitonment since GCC show more
warnings in this case. -O2 -g works fine.

For release purpose, debug information can be stripted on later stage.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-08-25 14:31:19 +03:00
Kirill A. Shutemov
c75a890b60 transport_git: add missed error handling
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-08-24 20:11:15 +03:00
Kirill A. Shutemov
d7f0ababe1 Fix false positive -Wuninitialized warnings
GCC produces several -Wuninitialized warnings. Most of them can be fixed
if we make visible for gcc that git__throw() and git__rethrow() always
return first argument.

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-08-24 20:10:50 +03:00
Vicent Marti
a7e34e3c85 transport: Merge bitfield
I don't think MSVC merges these automatically.
2011-08-18 02:35:28 +02:00
Vicent Marti
84dd3820d4 posix: Properly handle snprintf in all platforms 2011-08-18 02:35:28 +02:00
Vicent Marti
c85e08b1bd odb: Do not pass around a header when hashing 2011-08-18 02:34:10 +02:00