| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
When we're looking to update a tag, we can't stop if the tag auto-follow
rules don't say to update it. The tag might still match the refspec we
were given.
|
| |
|
|
|
|
| |
Introduce `git__getenv` which is a UTF-8 aware `getenv` everywhere.
Make `cl_getenv` use this to keep consistent memory handling around
return values (free everywhere, as opposed to only some platforms).
|
| |\
| |
| | |
Rename FALLBACK to UNSPECIFIED
|
| | |
| |
| |
| |
| | |
Fallback describes the mechanism, while unspecified explains what the
user is thinking.
|
| |/
|
|
|
|
|
|
|
| |
When a refspec contains no rhs and thus won't cause an explicit update,
we skip all the logic, but that means that we don't update FETCH_HEAD
with it, which is what the implicit rhs is.
Add another bit of logic which puts those remote heads in the list of
updates so we put them into FETCH_HEAD.
|
| |
|
|
|
|
| |
This is what we used to return in the settter and there's tests in
bindings which ask for this. There's no particular reason to stop doing
so.
|
| | |
|