| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
Pack file verification
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We strive to keep an options structure to many functions to be able to
extend options in the future without breaking the API. `git_indexer_new`
doesn't have one right now, but we want to be able to add an option
for enabling strict packfile verification.
Add a new `git_indexer_options` structure and adjust callers to use
that.
|
|/
|
|
|
|
|
|
|
| |
C++ style comment ("//") are not specified by the ISO C90 standard and
thus do not conform to it. While libgit2 aims to conform to C90, we did
not enforce it until now, which is why quite a lot of these
non-conforming comments have snuck into our codebase. Do a tree-wide
conversion of all C++ style comments to the supported C style comments
to allow us enforcing strict C90 compliance in a later commit.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The getline(3) function call is not part of ISO C and, most importantly,
it is not implemented on Microsoft Windows platforms. As our networking
example code makes use of getline, this breaks builds on MSVC and MinGW.
As this code wasn't built prior to the previous commit, this was never
noticed.
Fix the error by instead implementing a `readline` function, which
simply reads the password from stdin until it reads a newline
character.
|
|
|
|
|
|
|
|
| |
The credentials callback reads the username and password via scanf into
fixed-length arrays. While these are simply examples and as such not as
interesting, the unchecked return value of scanf causes GCC to emit
warnings. So while we're busy to shut up GCC, we also fix the possible
overflow of scanf by using getline instead.
|
|
|
| |
Format of a length of string to the correct format is:%.*s
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
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.
|
|
|
|
|
| |
This lets us see what the server (or libgit2 locally) is doing, rather
than having to stare at a non-moving screen.
|
| |
|
|
|
|
|
| |
Code restructured to better represent best practice when
using libgit2.
|
|
|
| |
Added forgotten call to git_libgit2_shutdown() to the /examples/network/git2.c.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
Local transports don't have data about the size, avoid dividing by
zero in the callback.
|
|
|
|
|
|
| |
This describes their purpose better, as we now initialize ssl and some
other global stuff in there. Calling the init function is not something
which has been optional for a while now.
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
- added MSVC cmake definitions to disable warnings
- general.c is rewritten so it is ansi-c compatible and compiles ok on microsoft windows
- some MSVC reported warning fixes
|
| |
|
|\
| |
| | |
Remote revamp (director's cut)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The callback-based method of listing remote references dates back to the
beginning of the network code's lifetime, when we didn't know any
better.
We need to keep the list around for update_tips() after disconnect() so
let's make use of this to simply give the user a pointer to the array so
they can write straightforward code instead of having to go through a
callback.
|
| | |
|
|/ |
|
|\
| |
| | |
Fix examples to make the important stuff more obvious
|
| | |
|
| |
| |
| |
| |
| | |
I'm not too happy about manually inserting < and > but those get
output as html tags otherwise.
|
|/
|
|
|
|
|
|
|
|
|
| |
It was there to keep it apart from the one which read in from a file on
disk. This other indexer does not exist anymore, so there is no need for
anything other than git_indexer to refer to it.
While here, rename _add() function to _append() and _finalize() to
_commit(). The former change is cosmetic, while the latter avoids
talking about "finalizing", which OO languages use to mean something
completely different.
|
|\
| |
| | |
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.
|
| |
| |
| |
| |
| |
| | |
When given an ODB from which to read objects, the indexer will attempt
to inject the missing bases at the end of the pack and update the
header and trailer to reflect the new contents.
|
| |
| |
| |
| | |
There's no need for this to be a pointer to somewhere else.
|
| |
| |
| |
| |
| | |
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.
|
| |
|