| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
cred: change enum to git_credential_t and GIT_CREDENTIAL_*
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We avoid abbreviations where possible; rename git_cred to
git_credential.
In addition, we have standardized on a trailing `_t` for enum types,
instead of using "type" in the name. So `git_credtype_t` has become
`git_credential_t` and its members have become `GIT_CREDENTIAL` instead
of `GIT_CREDTYPE`.
Finally, the source and header files have been renamed to `credential`
instead of `cred`.
Keep previous name and values as deprecated, and include the new header
files from the previous ones.
|
|/
|
|
|
| |
Stop returning a void for functions, future-proofing them to allow them
to fail.
|
|
|
|
|
|
|
|
|
|
|
| |
In "remote.c", we have a chunk of code that is #ifdef'fed out via
`#if 0` with a comment that we could export it as a helper function.
The code was implemented in 2013 and ifdef'fed in 2014, which shows that
there's clearly no interest in having such a helper at all.
As this block has recently created some confusion about `p_getenv` due
to it containing the only reference to that function in our codebase,
let's remove this block altogether.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In libgit2 nomenclature, when we need to verb a direct object, we name
a function `git_directobject_verb`. Thus, if we need to init an options
structure named `git_foo_options`, then the name of the function that
does that should be `git_foo_options_init`.
The previous names of `git_foo_init_options` is close - it _sounds_ as
if it's initializing the options of a `foo`, but in fact
`git_foo_options` is its own noun that should be respected.
Deprecate the old names; they'll now call directly to the new ones.
|
|
|
|
|
|
| |
Since libssh2 doesn't read host configuration from the config file,
this callback can be used to hand over URL resolving to the client
without touching the SSH implementation itself.
|
|
|
|
|
| |
Update internal usage of `git_transfer_progress` to
`git_indexer_progreses`.
|
|
|
|
|
| |
Move to the `git_error` name in the internal API for error-related
functions.
|
|
|
|
| |
Update internal usage to use the `git_reference` names for constants.
|
| |
|
|
|
|
| |
As it is, this is space for 32 refs pointers, which feels a little much.
Lower it to 8, as it is the minimum vector size anyway.
|
| |
|
| |
|
|
|
|
| |
This supersedes the functionality of remote_create_with_fetchspec, remote_create_anonymous and remote_create_detached.
|
|
|
|
| |
We need a repo/config and a name to be able to do anything to the configuration. As such, those two tests can be merged so their conditions are shared.
|
| |
|
| |
|
|\
| |
| | |
git_remote_prune to be O(n * logn)
|
| | |
|
|/
|
|
|
|
|
|
| |
This makes it easier to pass connection-related options around (proxy &
custom headers for now).
This fixes a bug in git_push_finish, which didn't reuse the provided
proxy if the connection closed between the call to `git_remote_push` and
the finish step.
|
|
|
| |
Otherwise we'll return stack data to the caller.
|
|
|
|
|
|
|
|
|
| |
Since commit 630a67366 (refspec: add public parsing api, 2018-02-07), we
now have two functions `git_refspec_free` and `git_refspec__free`. The
difference is that the first one will free the structure itself, while
the second one will only free the structure's contents. Use our new
`dispose` naming pattern for the latter function to help avoid
confusion.
|
| |
|
|
|
| |
As per CID:1378747, we might be called with a NULL repo, which would be deferenced in write_add_refspec
|
|
|
|
|
|
|
|
| |
We treat each refspec on its own, but the code currently overwrites the contents
of FETCH_HEAD so we end up with the entries for the last refspec we processed.
Instead, truncate it before performing the updates and append to it when
updating the references.
|
|\
| |
| | |
Include fixups
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Next to including several files, our "common.h" header also declares
various macros which are then used throughout the project. As such, we
have to make sure to always include this file first in all
implementation files. Otherwise, we might encounter problems or even
silent behavioural differences due to macros or defines not being
defined as they should be. So in fact, our header and implementation
files should make sure to always include "common.h" first.
This commit does so by establishing a common include pattern. Header
files inside of "src" will now always include "common.h" as its first
other file, separated by a newline from all the other includes to make
it stand out as special. There are two cases for the implementation
files. If they do have a matching header file, they will always include
this one first, leading to "common.h" being transitively included as
first file. If they do not have a matching header file, they instead
include "common.h" as first file themselves.
This fixes the outlined problems and will become our standard practice
for header and source files inside of the "src/" from now on.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Right now it is only possible to create remotes from a repository. While
this is probably the most common use-case, there are commands which make
sense even without a repository, e.g. the equivalence of `git
ls-remote`. Add a new function `git_remote_create_detached`, which
simply accepts a URL.
|
| |
| |
| |
| |
| |
| |
| | |
There are only few actions which actually make sense for a detached
remote, like e.g. `git_remote_ls`, `git_remote_prune`. For all the other
actions, we have to report an error when the remote has no repository
attached to it. This commit does so and implements some tests.
|
|/
|
|
|
|
|
| |
The current error message when connecting to a remote when no URL is set
is missing information on whether it is missing a fetch or push URL.
Furthermore, it results in undefined behavior when using a remote
without name. Fix both issues.
|
|
|
|
| |
This reverts commit 5552237 and frees the snapshot properly.
|
|\ |
|
| |
| |
| |
| | |
Since this is allowed in `git_remote_upload`
|
|/
|
|
| |
The regression was introduced in 22261344de18b3cc60ee6937468d66a6a6a28875
|
| |
|
| |
|
|
|
| |
curl supports HTTPS_PROXY in addition to https_proxy (and their http counterparts). This change ensures parity with curl's behavior.
|
|
|
|
|
|
|
|
| |
Error messages should be sentence fragments, and therefore:
1. Should not begin with a capital letter,
2. Should not conclude with punctuation, and
3. Should not end a sentence and begin a new one
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Somehow I ended up with the following in my ~/.gitconfig:
[branch "master"]
remote = origin
merge = master
rebase = true
I assume something went crazy while I was running the git.git tests
some time ago, and that I never noticed until now.
This is not a good configuration, but it shouldn't cause problems. But
it does. Specifically, if you have this in your config, and you
perform the following set of actions:
create a remote
fetch from that remote
create a branch off of the remote master branch called "master"
delete the branch
delete the remote
The remote delete fails with the message "Could not find key
'branch.master.rebase' to delete". This is because it's iterating over
the config entries (including the ones in the global config) and
believes that there is a master branch which must therefore have these
config keys.
https://github.com/libgit2/libgit2/issues/3856
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Set the error code when an error occurs in any of the called
functions. This ensures we pass the error up to callers and
actually free the remote when an error occurs.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|