| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|\
| |
| | |
examples: modernise the fetch example
|
| |
| |
| |
| |
| | |
Under normal conditions, git_remote_fetch() should be the only function
used to perform a fetch. Don't let the example lead people astray.
|
|/
|
|
| |
The header src/cc-compat.h defines portable format specifiers PRIuZ, PRIdZ, and PRIxZ. The original report highlighted the need to use these specifiers in examples/network/fetch.c. For this commit, I checked all C source and header files not in deps/ and transitioned to the appropriate format specifier where appropriate.
|
|
|
|
|
|
| |
An anonymous remote is not configured and cannot therefore have
configured refspecs. Remove the parameter which adds this from the
constructor.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The signature for the reflog is not something which changes
dynamically. Almost all uses will be NULL, since we want for the
repository's default identity to be used, making it noise.
In order to allow for changing the identity, we instead provide
git_repository_set_ident() and git_repository_ident() which allow a user
to override the choice of signature.
|
|
|
|
| |
This brings it in line with the rest of the lookup functions.
|
|
|
|
|
|
|
| |
With opportunistic ref updates, git has introduced the concept of having
base refspecs *and* refspecs that are active for a particular fetch.
Let's start by letting the user override the refspecs for download.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The order in this function is the opposite to what
create_with_fetchspec() has, so change this one, as url-then-refspec is
what git does.
As we need to break compilation and the swap doesn't do that, let's take
this opportunity to rename in-memory remotes to anonymous as that's
really what sets them apart.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
I'm not too happy about manually inserting < and > but those get
output as html tags otherwise.
|
|\
| |
| | |
Add support for thin packs
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The user is unable to derive the number of deltas in the pack, as that
would require them to capture the stats exactly in the moment between
download and final processing, which is abstracted away in the fetch.
Capture these numbers for the user and expose them in the progress
struct. The clone and fetch examples now also present this information
to the user.
|
| |
| |
| |
| |
| | |
Show how many local objects were used to fix the thin pack in our fetch
example.
|
| |
| |
| |
| |
| | |
Move this one as well, letting us have a single way of setting the
callbacks for the remote, and removing fields from the clone options.
|
|/
|
|
|
|
| |
The text progress and update_tips callbacks are already part of the
struct, which was meant to unify the callback setup, but the download
one was left out.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Compilers that are not aware that pthread_exit() does not return
issue a warning when compiling the present code. This change
exchanges the call to pthread_exit() with a simple return
statement. According to the pthread specification this is
equivalent.
|
| |
|
| |
|
|
|
|
| |
git_remote_add -> git_remote_create
git_remote_new -> git_remote_create_inmemory
|
| |
|
|
|
|
|
| |
Includes typedef for git_direction, and renames for
GIT_DIR_[FETCH|PUSH] to GIT_DIRECTION_(\1).
|
|
|
|
|
|
| |
This fixes a number of warnings and problems with cross-platform
builds. Among other things, it's not safe to name a member of a
structure "strcmp" because that may be #defined.
|
| |
|
| |
|
|
|
|
|
|
|
| |
git_indexer_stats and friends -> git_transfer_progress*
Also made git_transfer_progress members more sanely
named.
|
| |
|
|
|
|
| |
Also converted the network example to use it.
|
| |
|
|
|
|
|
| |
We can't always rely on the network telling us when the download is
finished. Recognize it from the indexer itself.
|
| |
|
|
|
|
|
|
|
| |
For the transition, http is going to keep its own logic until the
git/common code catches up with the implied multi_ack that http
has. This also has the side-effect of making the code cleaner and more
correct regardingt he protocol.
|
|
|
|
|
| |
Currently only update_tips is used, but it prepares the way for
progress output during download.
|
|
|
|
| |
http://github.com/libgit2/libgit2/pull/766
|
| |
|
| |
|
|
|
|
|
| |
Add a fetch refspec arguemnt and make the arguments (name, url,
refspec), as that order makes more sense.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, git_remote_disconnect not only closes the connection but also
frees the underlying transport object, making it impossible to write
code like
// fetch stuff
git_remote_download()
// close connection
git_remote_disconnect()
// call user provided callback for each ref
git_remote_update_tips(remote, callback)
because remote->refs points to references owned by the transport object.
This means, we have an idling connection while running the callback for
each reference.
Instead, allow immediate disconnect and free the transport later in
git_remote_free().
|
|
|
|
|
|
|
|
| |
This allows the caller to update an internal structure or update the
user output with the tips that were updated.
While in the area, only try to update the ref if the value is
different from its old one.
|
|
|
|
| |
This allows us to give updates on how it's doing
|
| |
|