Vicent Marti
01d7fded1b
Revert "Rewrite getenv to use Win32 version on Windows"
...
This reverts commit e1b8644467 .
2011-09-27 14:33:18 +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
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 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
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
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
222d057c22
Create cross-platform setenv
2011-09-19 10:34:52 -07:00
Vicent Marti
19d869bb2e
Fix warning in status.c
2011-09-19 06:31:54 +03:00
Vicent Martí
71a4c1f16f
Merge pull request #384 from kiryl/warnings
...
Add more -W flags to CFLAGS
2011-09-18 20:07:59 -07:00
Vicent Martí
a807607470
Merge pull request #397 from lambourg/development
...
Fix compilation issues with mingw64 headers
2011-09-18 20:00:19 -07:00
Vicent Martí
ae996e029f
Merge pull request #394 from carlosmn/tree-fromindex
...
Use git_treebuilder to write the index as a tree
2011-09-18 19:59:34 -07:00
Vicent Martí
6640266e5a
Merge pull request #398 from carlosmn/config-autohome
...
git_repository_config: open global config file automatically
2011-09-18 19:58:22 -07:00
Vicent Martí
71b84c639a
Merge pull request #408 from schu/fixup-status
...
Fixup status.c
2011-09-18 19:55:48 -07:00
Vicent Martí
3125929bc4
Merge pull request #393 from schu/unused-but-set-variable
...
filebuf.c: fix unused-but-set warning
2011-09-18 19:54:18 -07:00
Vicent Martí
b6ed727a45
Merge pull request #392 from sschuberth/development
...
Fix a bug and GCC warning introduced in 932669b
2011-09-18 19:52:40 -07:00
Vicent Martí
b3c524d104
Merge pull request #399 from carlosmn/free-null
...
Add checks for NULL to the config and remote free functions
2011-09-18 19:46:12 -07:00
Vicent Marti
87d9869fc3
Tabify everything
...
There were quite a few places were spaces were being used instead of
tabs. Try to catch them all. This should hopefully not break anything.
Except for `git blame`. Oh well.
2011-09-19 03:34:49 +03:00
Vicent Marti
bb742ede3d
Cleanup legal data
...
1. The license header is technically not valid if it doesn't have a
copyright signature.
2. The COPYING file has been updated with the different licenses used in
the project.
3. The full GPLv2 header in each file annoys me.
2011-09-19 01:54:32 +03:00
schu
855f06606d
status.c: add missing check for error
...
dirent_cb() didn't check the return value of determine_status().
Signed-off-by: schu <schu-github@schulog.org>
2011-09-17 17:28:39 +02:00
schu
ef37489041
status.c: remove wrong address operator
...
Signed-off-by: schu <schu-github@schulog.org>
2011-09-17 12:14:13 +02:00
nulltoken
d8b903dab0
status: enhance determination of statuses for a whole directory
...
- Should increase performance through usage of a walker
- No callback invocation for unaltered entries
2011-09-15 01:14:36 +02:00
nulltoken
56453d3468
status: enhance determination of status for a single file
...
- fix retrieval of a file status when working against a newly initialized repository
- reduce memory pressure
- prevents a directory from being tested
2011-09-15 01:14:36 +02:00
nulltoken
3601c4bfce
repository: Add git_repository_head()
2011-09-15 01:13:50 +02:00
Carlos Martín Nieto
2aae218881
Add checks for NULL to the config and remote free functions
...
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-13 02:05:12 +02:00
Sebastian Schuberth
79a343968a
Fix a bug and GCC warning introduced in 932669b
...
For unsigned types, the comparison >= 0 is always true, so avoid it by using
a post-decrement and integrating the initial assigment into the loop body.
No change in behavior is intended.
2011-09-12 22:22:59 +02:00
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
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
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 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
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
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
Carlos Martín Nieto
7adba5f49c
Keep sending want lines if the server doesn't anwer a flush
...
Some servers take a long time to answer and expect us to keep sending
want lines; otherwise they close the connection. Avoid this by waiting
for one second for the server to answer. If the timeout runs out,
treat is as a NAK and keep sending want lines.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:10 +02:00
Carlos Martín Nieto
427ca3d3c5
Actually implement object negotiation
...
Only signal that we need a pack if we do need it and don't send a want
just because it's the first. If we don't need to download the pack,
then we can skip all of the negotiation and just return success.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:10 +02:00
Carlos Martín Nieto
946dab73ba
Implement and bind local_send_wants
...
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:10 +02:00
Carlos Martín Nieto
22f65b9e73
Move negotiation to the transport
...
There are many ways how a transport might negotiate with the server,
so instead of making it fit into the smart protocol model, let the
transport do its thing. For now, the git protocol limits itself to
send only 160 "have" lines so we don't flood the server.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:10 +02:00
Carlos Martín Nieto
79e9c3eca2
Update transport lifetime documentation
...
The original was written before any code was written and had nothing
to do with the way things are actually done.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:09 +02:00
Carlos Martín Nieto
cdfd7bd057
Use time sorting in fetch
...
This is what the docs say tha we should use.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:09 +02:00
Carlos Martín Nieto
a1be77cd35
Be smarter about selecting wants
...
There is no need to inspect what the local repository is like. Only
check whether the objects exist locally.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:09 +02:00
Carlos Martín Nieto
1564db11fe
Remove enum git_whn
...
Instead, use flags inside the git_remote_head structure.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:09 +02:00
Carlos Martín Nieto
ade3c9bb88
Assert a filename in indexer creation
...
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:09 +02:00
Carlos Martín Nieto
7284c1059f
Don't try to download the packfile too early
...
Make sure we only try to download the pack if we find the pack header
in the stream, and not if the server takes a bit longer to send us the
last NAK.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:08 +02:00
Carlos Martín Nieto
441f57c2b7
Add git_remote_update_tips
...
This function updates the references in the local reference storage to
match the ones in the remote.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:08 +02:00
Carlos Martín Nieto
c1af5a3935
Implement cooperative caching
...
When indexing a file with ref deltas, a temporary cache for the
offsets has to be built, as we don't have an index file yet. If the
user takes the responsiblity for filling the cache, the packing code
will look there first when it finds a ref delta.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:08 +02:00
Carlos Martín Nieto
061047ccb6
Rethrow pack entry offset error
...
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:08 +02:00
Carlos Martín Nieto
2f512ff81e
Use strcpy+strcat as memcpy was overlapping
...
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:08 +02:00
Carlos Martín Nieto
0437d991bf
Use common capabilities
...
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:08 +02:00
Carlos Martín Nieto
48a65a071d
Only wait for pack if we need it
...
Provide the git_remote_download function to instruct the library to
downlad the packfile and let the user know the temporary location.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:08 +02:00
Carlos Martín Nieto
9cf0f287bb
Tell the user where the downloaded packfile is stored
...
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:08 +02:00
Carlos Martín Nieto
e1d8803068
Don't expose the fetch code to the user
...
Move the generation of the want-list to be done from the negotiate
function, and keep the filtered references inside the remote
structure.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:08 +02:00
Carlos Martín Nieto
44daec4229
Bind the configuration and remotes to a repository
...
Configurations when taken from a repository and remotes should be
identifiable as coming from a particular repository. This allows us to
reduce the amount of variables that the user has to keep track of.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:08 +02:00
Carlos Martín Nieto
da2902204b
Download pack
...
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:07 +02:00
Carlos Martín Nieto
7e1a94db11
Move have sending
...
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:07 +02:00
Carlos Martín Nieto
b4c9063040
Implement sending haves
...
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:07 +02:00
Carlos Martín Nieto
0e20ba6066
Add a generic send_wants
...
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:07 +02:00
Carlos Martín Nieto
65fbc48a17
negotiation
2011-08-18 02:34:07 +02:00
Carlos Martín Nieto
0132cf6438
git_pkt_send_wants
2011-08-18 02:34:07 +02:00
Carlos Martín Nieto
e1f4a76150
Add git_fetch_list_want which creates the "want" list
...
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-18 02:34:07 +02:00
schu
d4958b8848
refs.c: remove two lines of dead code
...
Signed-off-by: schu <schu-github@schulog.org>
2011-08-17 16:37:59 +02:00
schu
e7a3b3171b
reflog.c: fix memory leaks
...
Signed-off-by: schu <schu-github@schulog.org>
2011-08-17 16:37:53 +02:00
schu
31e5909214
git__strndup: immediately return NULL when ENOMEM
...
Signed-off-by: schu <schu-github@schulog.org>
2011-08-17 15:24:48 +02:00
schu
5a0659fe3b
config_file.c: fix memory leaks
...
Signed-off-by: schu <schu-github@schulog.org>
2011-08-17 14:36:53 +02:00
schu
b6817692a6
tsort.c: fix include of common.h
...
Signed-off-by: schu <schu-github@schulog.org>
2011-08-17 12:14:47 +02:00
schu
7fade6c63a
unix/posix.h: remove redundant include
...
Signed-off-by: schu <schu-github@schulog.org>
2011-08-17 12:14:12 +02:00
Carlos Martín Nieto
50a8fd0367
Fix the reference character check for Unicode
...
We need to do an unsigned comparison, as otherwise UTF-8 characters
might look like they have the sign bit set and the check will fail.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
2011-08-16 18:16:44 +02:00
schu
bcb080b00a
reflog: fix memory leaks
...
Make sure to free the existing reflog when we run out or memory while
adding new entries.
Signed-off-by: schu <schu-github@schulog.org>
2011-08-16 10:17:26 +02:00
schu
e7be57a98b
reflog: assimilate reflog API to return git_oid's
...
Rather than returning the OIDs out of the reflog as string return them
as git_oid.
Signed-off-by: schu <schu-github@schulog.org>
2011-08-15 21:14:51 +02:00
Vicent Marti
5ae2f0c013
commit: Add support for Encoding header
2011-08-12 16:24:19 -07:00
Vicent Martí
2133c44f6a
Merge pull request #355 from jdavid/fix-build
...
Fix "redefinition of typedef git_indexer" build error
2011-08-09 17:08:18 -07:00
Vicent Martí
7bc3d0c86d
Merge pull request #361 from nulltoken/ntk/fix/wrap-strcmp
...
util: Add git__strcmp_cb() wrapper
2011-08-09 17:04:48 -07:00
nulltoken
d1f346931a
util: Add git__strcmp_cb() wrapper
...
We don't want direct pointers to the CRT on Windows, we may get stdcall conflicts.
2011-08-09 22:34:54 +02:00
schu
33e9ee8f12
mwindow.c: fix -Wmissing-field-initializers
...
Signed-off-by: schu <schu-github@schulog.org>
2011-08-09 12:55:51 +02:00
Vicent Marti
f6867e639a
Fix compilation in Windows
2011-08-08 16:56:28 -07:00
Vicent Marti
09df3f2c0f
transport: Wrap strcmp
...
We don't want direct pointers to the CRT on Windows, we may
get stdcall conflicts.
2011-08-08 11:15:40 -07:00
Carlos Martín Nieto
8c1d5d4839
Use the internal sort in the local transport
...
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-06 16:33:24 +02:00
J. David Ibáñez
2d3e417e5f
Fix "redefinition of typedef git_indexer" build error
...
Signed-off-by: J. David Ibáñez <jdavid@itaapy.com>
2011-08-05 15:17:48 +02:00
Carlos Martín Nieto
97f40a0d5c
Check for error calculating the delta base
...
Don't assume that it's always going to work.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-04 22:51:46 +02:00
Vicent Martí
31bf5f3857
Merge pull request #345 from carlosmn/gsoc2011/indexer
...
Implement a pack indexer
2011-08-03 18:59:30 -07:00
Vicent Martí
20c1bca123
Merge pull request #349 from MasterGrumpy/development
...
git_status_foreach issue
2011-08-03 18:56:25 -07:00
schu
63396a3998
signature: adjust API to return error codes
...
git_signature_new() and git_signature_now() currently don't return error
codes. Change the API to return error codes and not pointers to let the
user handle errors properly.
Signed-off-by: schu <schu-github@schulog.org>
2011-08-03 16:05:32 +02:00
Carlos Martín Nieto
48b3ad4f15
Move pack index writing to a public function
...
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-03 14:02:49 +02:00
Carlos Martín Nieto
b7c44096ae
Implement the indexer
...
Only v2 index files are supported.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-03 14:02:41 +02:00
Luc Bertrand
8f643ce8e3
Remove duplicated sort
2011-08-03 13:44:28 +02:00
Luc Bertrand
9d9e492dc0
remove unused variable
2011-08-03 13:38:02 +02:00
Luc Bertrand
8cf077f4d5
fix recurse_tree_entries, continue parsing tree after first subdirectory found
2011-08-03 13:37:24 +02:00
schu
5274c31a89
signature.c: fix off-by-one error
...
Signed-off-by: schu <schu-github@schulog.org>
2011-08-03 01:17:31 +02:00
Carlos Martín Nieto
bcf21c556c
Add git_vector_foreach
...
You can use it just as you'd use a for-loop
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-02 21:42:04 +02:00
Carlos Martín Nieto
b5b474dd0d
Modify the given offset in git_packfile_unpack
...
The callers immediately throw away the offset, so we don't need any
logical changes in any of them. This will be useful for the indexer,
as it does need to know where the compressed data ends.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-02 21:42:03 +02:00
Carlos Martín Nieto
a070f152bd
Move pack functions to their own file
2011-08-02 21:42:03 +02:00
Carlos Martín Nieto
7d0cdf82be
Make packfile_unpack_header more generic
...
On the way, store the fd and the size in the mwindow file.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-02 21:42:03 +02:00
Carlos Martín Nieto
ab525a7463
Rename stuff to git_indexer_
...
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-02 21:41:33 +02:00
Carlos Martín Nieto
f23c4a66bd
Start the runner
...
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-02 21:41:05 +02:00
Carlos Martín Nieto
3412391d4c
Intial indexer code
2011-08-02 21:41:02 +02:00
Carlos Martín Nieto
c7c9e18388
Move the pack structs to an internal header
2011-08-02 20:53:51 +02:00
Carlos Martín Nieto
7bfdb3d22b
Factor out the mmap window code
...
This code is useful for more things than just the packfile handling
code. Factor it out so it can be reused.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-02 20:53:51 +02:00
Lambert CLARA
7d3ec3caac
Fix memory leak when wrong object type is looked up from cache
...
Update unit test accordingly : no need to close
2011-08-02 19:23:00 +02:00
schu
eed2714ba5
reflog: avoid users writing a wrong ancestor OID
...
Disallow NULL as ancestor OID when writing a reflog entry for an
existing reference.
Signed-off-by: schu <schu-github@schulog.org>
2011-08-01 17:02:42 +02:00
Vicent Martí
cb1c75635e
Merge pull request #335 from carlosmn/read-updated
...
Don't stat so much when reading references
2011-07-28 05:32:47 -07:00
Kirill A. Shutemov
05a62d1a82
filebuf: update git_filebuf.write signature to take non-const buffer
...
z_stream.next_in is non-const. Although currently Zlib doesn't modify
buffer content on deflate(), it might be change in the future. gzwrite()
already modify it.
To avoid this let's change signature of git_filebuf.write and rework
git_filebuf_write() accordingly.
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-07-25 21:12:48 +02:00
Kirill A. Shutemov
76159921f4
index: rework index entry initialization routine
...
index_init_entry() renamed to index_entry_init(). Now it allocates entry
on its own.
git_index_add() and git_index_append() reworked accordingly.
This commit fixes warning:
/home/kas/git/public/libgit2/src/index.c: In function ‘index_init_entry’:
/home/kas/git/public/libgit2/src/index.c:452:14: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-07-25 21:12:47 +02:00
Kirill A. Shutemov
f939d39bec
index: rework index_insert()
...
Now index_insert() takes copy of index entry, not coping it by itself.
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-07-25 21:12:47 +02:00
Kirill A. Shutemov
b2dd681512
index: introduce index_entry_free()
...
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-07-25 21:12:47 +02:00
Kirill A. Shutemov
51917d9ca2
index: extract index_entry_dup() from index_insert()
...
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-07-25 21:12:47 +02:00