| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
`git_futils_rmdir_r`: rename, clean up.
`git_reference_rename`: cleanup. Do not use 3x4096 buffers on the stack
or things will get ugly very fast. We can reuse the same buffer.
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
- msvc compilation warnings
- not released file handle that prevents file removal
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
So far libgit2 didn't handle the following scenarios:
* Rename of reference m -> m/m
* Rename of reference n/n -> n
Fixed.
Since we don't write reflogs, we have to delete any old reflog for the
renamed reference. Otherwise git.git will possibly fail when it finds
invalid logs.
Reported-by: nulltoken <emeric.fermas@gmail.com>
Signed-off-by: schu <schu-github@schulog.org>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
git_futils_rmdir_recurs() shall remove the given directory and all
subdirectories. This happens only if the directories are empty.
Signed-off-by: schu <schu-github@schulog.org>
|
| |/
|/|
| |
| | |
Signed-off-by: schu <schu-github@schulog.org>
|
| | |
|
| | |
|
| |
| |
| |
| | |
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|/ |
|
| |
|
|\
| |
| | |
Small fixes in pack_window_open
|
| |
| |
| |
| |
| |
| |
| | |
Check if the window structure has actually been allocated before
trying to access it, and don't leak said structure if the map fails.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|\ \
| |/
|/| |
Fix MSVC compilation issue
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Without this, hashtable.h doesn't know what uint32_t is and the
compiler thinks that it's a function type.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
|\ \
| |/
|/| |
A bit of networking
|
| |
| |
| |
| |
| |
| |
| |
| | |
Remove the unused repo and private pointers and make the direction a
flag, as it can only have two states. Change the connect signature to
use an int instead of git_net_direction and remove that enum.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| |
| |
| | |
At the same time, do mark the transport as connected.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| |
| |
| |
| | |
These allow you to implement git-ls-remote when given a reference name
and a repository.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| |
| |
| | |
This allows us to leave out the buffer handling logic.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| | |
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| | |
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Rather than an 'private' pointer, make the private structures inherit
from the generic git_transport struct. This way, we only have to worry
about one memory allocation instead of two. The structures are so
simple that this may even make the code use less memory overall.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| |
| |
| |
| | |
Store the ref information in a private struct so we can free it
together with the rest.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
By pre-sorting the references, they are already in the right order if
we want to peel them.
With this, we get output-parity with git.git's ls-remote.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| |
| |
| |
| | |
This is where they really belong. Remvoe the prefix and make them
static.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| | |
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This makes it easier to send a requqest for an URL. It assumes there
is a socket where the string should go out to.
Make git_pkt_gen_proto accept a command parameter, which defaults to
git-upload-pack
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| | |
|
| |
| |
| |
| | |
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a parameter to git_pkt_parse_line to tell it how much data you
have in your buffer. If the buffer is too short, it returns an error
saying so. Adapt the git transport to use this and fix the offset
calculation.
Add the GIT_ESHORTBUFFER error code.
|
| |
| |
| |
| |
| |
| |
| | |
A git_pkt object can be one of several structs. Add this function for
convenience and clarity.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| | |
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| |
| |
| | |
Add git_pkt_gen_proto to crete a request from an url.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| |
| |
| |
| | |
Try to read the server capabilities and add them to the git_pkt_ref
struct.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| |
| |
| | |
Add support for parsing other-ref lines.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| |
| |
| |
| |
| | |
A pkt-line's length are described in its first four bytes in ASCII
hex. Copy this substring to another string before feeding it to
git__strtol32. Otherwise, it will read the whole hash.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| | |
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This are the types I intend to use for pkt-line parsing and (later)
creation. git_pkt serves as a base pointer type and once you know what
type it is you can use the real one (command, tip list, etc.)
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| | |
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| | |
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| | |
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If the strings match, git__fnmatch returns GIT_SUCCESS and
GIT_ENOMATCH on failure to match.
MSVC fixes: Added a test for _MSC_VER and (in that case) defined
HAVE_STRING_H to 1 so it doesn't try to include <strings.h> which
doesn't exist in the MSVC world. Moved the function declarations to
use the modern inline ones so MSVC doesn't have a fit. Added casts
everywhere so MSVC doesn't crap its pants.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Move them to their own functions to avoid duplication and to make it
easier to ignore missing configuration.
Not finding 'fetch' is considered fatal, though this might not be
correct behaviour (push-only remotes?)
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| | |
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If the section header is the last line in the file,
parse_section_header would incorrectly decide that the input had been
truncated.
Fix this by checking whether the actual input line is correctly
formatted.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
| |
| |
| |
| |
| |
| | |
Otherwise, the information about why there was an error gets lost.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
| |
| |
| |
| | |
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
|
| |
| |
| |
| |
| |
| | |
Add extra braces to avoid ambiguous if-else.
Also, free() doesn't need a check.
|