| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Remove most of the silly warnings
|
| | |
|
|/ |
|
|
|
|
|
|
| |
This fits with the style for the rest of the project, but more
importantly, makes life easier for bindings authors who auto-generate
code.
|
|
|
|
|
|
| |
Reload the HEAD and index data for a submodule after reading the
configuration. The configuration may specify a `path`, so we must
update HEAD and index data with that path in mind.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
When searching for information about a submdoule, let's be more explicit
in what we expect to find. We currently insert a submodule into the map
and change certain parameters when the config callback gets called.
Switch to asking for the configuration we're interested in, rather than
taking it in an arbitrary order.
|
| |
|
|\
| |
| | |
Normalize submodule urls before looking at them
|
| |
| |
| |
| | |
Extract the backslash-to-slash conversion into a helper function.
|
| |
| |
| |
| |
| |
| | |
Our path functions expect to work with slashes, so convert a
path with backslashes into one with slashes at the top of
the function.
|
|/
|
|
|
|
| |
If we get the path from the gitmodules file, look up the submodule we're
interested in by path, rather then by name. Otherwise we might get
duplicate results.
|
|
|
|
|
|
|
|
|
|
| |
The regex we use to look at the gitmodules file does not correctly
delimit the name of submodule which we want to look up and puts '.*'
straight after the name, maching on any submodule which has the seeked
submodule as a prefix of its name.
Add the missing '\.' in the regex so we want a full stop to exist both
before and after the submodule name.
|
|\
| |
| | |
Remove some warnings
|
| | |
|
| |
| |
| |
| |
| | |
We allow looking up a submodule by path, but we lost the path
normalisation during the recent changes. Bring it back.
|
|/
|
|
|
| |
Remove some of the logic that was left-over from the time we had a cache
of submodules, plugging a leak of the submodule object in certain cases.
|
|
|
|
|
| |
Fallback describes the mechanism, while unspecified explains what the
user is thinking.
|
|
|
|
|
|
| |
We currently do not handle those enum values which require us to set
"true" or unset variables in all cases. Use a common function which does
understand this by looking at our mapping directly.
|
|
|
|
|
| |
We no longer have any setters which affect an instance, so
`git_submodule_save()` is no longer relevant.
|
|
|
|
| |
With this one, we can get rid of the edit_and_save test.
|
| |
|
|
|
|
|
|
| |
Similarly to the other ones. In this test we copy over testing
`RECURSE_YES` which shows an error in our handling of the `YES` variant
which we may have to port to the rest.
|
|
|
|
|
| |
Moving on with the removal of runtime-changing variables, the update
setting for a remote is whatever it was when it was looked up.
|
|
|
|
|
|
|
|
|
| |
During the cache deletion, the check for whether we consider a submodule
to exist got changed regarding submodules which are in the worktree but
not configured.
Instead of checking for the url field to be populated, check the
location where we've found it.
|
|
|
|
|
| |
During the removal of the cache, we also removed the ability to use
`_lookup()` to search by path rather than name. Bring this logic back.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This lets us specify in the status call which ignore rules we want to
use (optionally falling back to whatever the submodule has in its
configuration).
This removes one of the reasons for having `_set_ignore()` set the value
in-memory. We re-use the `IGNORE_RESET` value for this as it is no
longer relevant but has a similar purpose to `IGNORE_FALLBACK`.
Similarly, we remove `IGNORE_DEFAULT` which does not have use outside of
initializers and move that to fall back to the configuration as well.
|
|
|
|
|
|
| |
As submodules are becomes more like values, we should not let a status
check to update its properties. Instead of taking a submodule, have
status take a repo and submodule name.
|
|
|
|
|
| |
Instead of affecting a particular instance, make it change the
configuration.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Having this cache and giving them out goes against our multithreading
guarantees and it makes it impossible to use submodules in a
multi-threaded environment, as any thread can ask for a refresh which
may reallocate some string in the submodule struct which we've accessed
in a different one via a getter.
This makes the submodules behave more like remotes, where each object is
created upon request and not shared except explicitly by the user. This
means that some tests won't pass yet, as they assume they can affect the
submodule objects in the cache and that will affect later operations.
|
|
|
|
|
|
| |
This is used by the submodule in order to figure out if the index has
changed since it last read it. Using a timestamp is racy, so let's make
it use the checksum, just like we now do for reloading the index itself.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
Currently git_submodule_sync writes the submodule's URL to the
key 'branch.<REMOTE_NAME>.remote' while the reference
implementation of `git submodule sync` writes to
'remote.<REMOTE_NAME>.url', which is the intended behavior
according to git-submodule(1).
|
|
|
|
|
|
| |
We want to use the "checkout: moving from ..." message in order to let
git know when a change of branch has happened. Make the convenience
functions for this goal write this message.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Without this change, compiling with gcc and pedantic generates warning:
ISO C does not allow extra ‘;’ outside of a function.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
This introduces the functionality of submodule update in
'git_submodule_do_update'. The existing 'git_submodule_update' function is
renamed to 'git_submodule_update_strategy'. The 'git_submodule_update'
function now refers to functionality similar to `git submodule update`,
while `git_submodule_update_strategy` is used to get the configured value
of submodule.<name>.update.
|
|
|
|
|
| |
Submodule init should handle relative paths in .gitmodules files
and resolve these urls when updating the git config file.
|
|
|
|
| |
This brings it in line with the rest of the lookup functions.
|
|
|
|
|
|
|
| |
Teach git_repository_init_ext to use relative paths for the gitlink
to the work directory. This is used when creating a sub repository
where the sub repository resides in the parent repository's
.git directory.
|
|
|
|
|
|
|
|
|
|
|
| |
This adds in missing calls to `git_buf_sanitize` and fixes a
number of places where `git_buf` APIs could inadvertently write
NUL terminator bytes into invalid buffers. This also changes the
behavior of `git_buf_sanitize` to NUL terminate a buffer if it can
and of `git_buf_shorten` to do nothing if it can.
Adds tests of filtering code with zeroed (i.e. unsanitized) buffer
which was previously triggering a segfault.
|
|
|
|
|
|
|
| |
This is a big refactoring of the attribute file cache to be a bit
simpler which in turn makes it easier to enforce a lock around any
updates to the cache so that it can be used in a threaded env.
Tons of changes to the attributes and ignores code.
|
|
|
|
|
|
| |
This adds a basic test of doing simultaneous diffs on multiple
threads and adds basic locking for the attr file cache because
that was the immediate problem that arose from these tests.
|
|
|
|
|
| |
I wrote this stuff a while ago and forgot to write tests. Wanted
to do so now to wrap up the PR and immediately found problems.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The base for the relative urls is determined as follows, with descending
priority:
- remote url of HEAD's remote tracking branch
- remote "origin"
- workdir
This follows git.git behaviour
|