| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
A remote's URLs are now modified according to the url.*.insteadOf
and url.*.pushInsteadOf configurations. This allows a user to
replace URL prefixes by setting the corresponding keys. E.g.
"url.foo.insteadOf = bar" would replace the prefix "bar" with the
new prefix "foo".
|
|
|
|
|
| |
These are updates, same as the rest, we should call this callback. As we
are using the callback, let's make sure to skip unnecessary updates.
|
|
|
|
|
|
|
| |
When we moved from acting on the instance to acting on the
configuration, we dropped the validation of the passed refspec, which
can lead to writing an invalid refspec to the configuration. Bring that
validation back.
|
|
|
|
|
|
| |
An anonymous remote is not configured and cannot therefore have
configured refspecs. Remove the parameter which adds this from the
constructor.
|
|
|
|
|
|
|
|
| |
These were left over from the culling as it's not clear which use-cases
might benefit from this. It is not clear that we want to support any
use-case which depends on changing the remote's idea of the base
refspecs rather than passing in different per-operation refspec list, so
remove these functions.
|
|
|
|
|
| |
We're down to simply having it be a call to create_internal() so let's
simply do that. The rest of the code is just a distraction.
|
|
|
|
|
| |
It has now become a no-op, so remove the function and all references to
it.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The base refspecs changing can be a cause of confusion as to what is the
current base refspec set and complicate saving the remote's
configuration.
Change `git_remote_add_{fetch,push}()` to update the configuration
instead of an instance.
This finally makes `git_remote_save()` a no-op, it will be removed in a
later commit.
|
|
|
|
|
| |
This is another option which we should not be keeping in the remote, but
is specific to each particular operation.
|
|
|
|
|
|
| |
While this will rarely be different from the default, having it in the
remote adds yet another setting it has to keep around and can affect its
behaviour. Move it to the options.
|
|
|
|
|
|
|
| |
Instead of having it set in a different place from every other callback,
put it the main structure. This removes some state from the remote and
makes it behave more like clone, where the constructors are passed via
the options.
|
|
|
|
|
| |
Add a prune setting in the fetch options to allow to fall back to the
configuration (the default) or to set it on or off.
|
|
|
|
|
|
| |
As a first step in removing the repository-saving logic, don't allow
chaning the url or push url from a remote object, but change the
configuration on the configuration immediately.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Having the setting be different from calling its actions was not a great
idea and made for the sake of the wrong convenience.
Instead of that, accept either fetch options, push options or the
callbacks when dealing with the remote. The fetch options are currently
only the callbacks, but more options will be moved from setters and
getters on the remote to the options.
This does mean passing the same struct along the different functions but
the typical use-case will only call git_remote_fetch() or
git_remote_push() and so won't notice much difference.
|
|
|
|
|
|
|
|
|
| |
The push object knows which remote it's associated with, and therefore
does not need to keep its own copy of the callbacks stored in the
remote.
Remove the copy and simply access the callbacks struct within the
remote.
|
|\
| |
| | |
[WIP/RFC] push: report the update plan to the caller
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It can be useful for the caller to know which update commands will be
sent to the server before the packfile is pushed up. git does this via
the pre-push hook.
We don't have hooks, but as it adds introspection into what is
happening, we can add a callback which performs the same function.
|
|/
|
|
|
|
|
|
|
|
|
|
| |
In checkout.c and filter.c we were casting a sub struct
to a parent struct which breaks the strict aliasing rules
in C. However we can use .parent or .base to access the
parent struct to avoid the build warnings.
In remote.c the local variable error was not initialized
or updated in some cases. For unintialized error a build
warning will be generated. So always keep error variable
up-to-date.
|
|\
| |
| | |
Update tips fixes
|
| | |
|
|/
|
|
|
| |
Otherwise, bailing out early when ls_to_vector() fails accesses
uninitialized memory.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes the get_entry() method to return a refcounted version of
the config entry, which you have to free when you're done.
This allows us to avoid freeing the memory in which the entry is stored
on a refresh, which may happen at any time for a live config.
For this reason, get_string() has been forbidden on live configs and a
new function get_string_buf() has been added, which stores the string in
a git_buf which the user then owns.
The functions which parse the string value takea advantage of the
borrowing to parse safely and then release the entry.
|
|
|
|
| |
We always use "update by push".
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Introduce some helper macros to test integer overflow from arithmetic
and set error message appropriately.
|
| |
|
| |
|
| |
|
|
|
|
| |
git_remote_download() must also clear the internal push state resulting from a possible earlier push operation. Otherwise calling git_remote_update_tips() will execute the push version instead of the fetch version and among other things, tags won't be updated.
|
|\
| |
| | |
Remote-tracking branch prunning
|
| |
| |
| |
| |
| |
| |
| |
| | |
This option does not get persisted to disk, which makes it different
from the rest of the setters. Remove it until we go all the way.
We still respect the configuration option, and it's still possible to
perform a one-time prune by calling the function.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For each remote-tracking branch we want to remove, we need to consider
it against every other refspec in case we have overlapping refspecs,
such as with
refs/heads/*:refs/remotes/origin/*
refs/pull/*/head:refs/remotes/origin/pr/*
as we'd otherwise remove too many refspecs.
Create a list of condidates, which are the references matching the rhs
of any active refspec and then filter that list by removing those
entries for which we find a remove reference with any active
refspec. Those which are left after this are removed.
|
| |
| |
| |
| |
| | |
This makes a fetch+prune more similar to a connect+prune and makes it
more likely that we see errors in the decision to prune a reference.
|
| | |
|
| | |
|
|/
|
|
|
| |
Instead we provide git_remote_upload() and git_remote_update_tips() in
order to have a parallel API for fetching and pushing.
|
|
|
|
|
| |
The push cannot be successful if we sent a bad packfile. We should
return an error in that case instead of storing it elsewhere.
|
| |
|
|
|
|
| |
Valgrind is now clean except for libssl and libgcrypt.
|
|
|
|
|
| |
Make it clear that this is not the ls-remote command but a way to access
the data we have and how long it's kept around.
|
|\
| |
| | |
Provide a convenience function `git_remote_push()`
|
| |
| |
| |
| |
| | |
If the user does not pass any refspecs to push, try to use those
configured via the configuration or via add_push().
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This function, similar in style to git_remote_fetch(), performs all the
steps required for a push, with a similar interface.
The remote callbacks struct has learnt about the push callbacks, letting
us set the callbacks a single time instead of setting some in the remote
and some in the push operation.
|
|/
|
|
|
|
|
|
|
| |
When creating a new remote, contrary to loading one from disk,
active_refspecs was not populated. This means that if using the new
remote to push, git_push_update_tips() will be a no-op since it
checks the refspecs passed during the push against the base ones
i.e. active_refspecs. And therefore the local refs won't be created
or updated after the push operation.
|