| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Richard Maw <richard.maw@gmail.com>
|
|
|
|
|
|
|
| |
This uses the same age file as before if it's in the root namespace,
but puts the agefile in info/web/namespaced/$GIT_NAMESPACE/last-modified.
Signed-off-by: Richard Maw <richard.maw@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
This adds "repo.agefile", since namespaced repositories share the same files,
and we'd like to be able to see the ages of the refs for each namespace.
Whatever the git server uses for updating the age file must be namespace aware
and must write the age file to a path consistent with "repo.agefile".
Signed-off-by: Richard Maw <richard.maw@gmail.com>
|
|
|
|
| |
Signed-off-by: Richard Maw <richard.maw@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We must not leave it at its default behaviour,
as that results in notes from the root namespace being used
and ignoring notes from the current namespace,
since it is not namespace aware.
We can handle this by instructing it to not load the default refs,
and providing a set of extra refs to use.
The provided extra refs are globs rather than ref names,
so we should escape them to be sure.
We get an annoying warning if the provided ref does not exist,
so we check whether the ref exists before attempting to provide it.
Signed-off-by: Richard Maw <richard.maw@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This requires namespacing the HEAD symbolic ref
and the list of refs.
Sending HEAD required some tweaking,
since the file itself refers to a namespaced ref,
but we want to provide the ref with its namespace stripped off.
Signed-off-by: Richard Maw <richard.maw@gmail.com>
|
|
|
|
| |
Signed-off-by: Richard Maw <richard.maw@gmail.com>
|
|
|
|
|
|
|
|
| |
The find_current_ref callback does not need to be modified
to strip off the namespace prefix,
since the for_each_ref functions don't include the base ref prefix.
Signed-off-by: Richard Maw <richard.maw@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
libgit has a for_each_namespaced_ref,
but lacks equivalents for just branches, tags or remotes.
Rather than implementing all of those helpers,
it's more convenient to implement just one
that prepends the namespace to the provided ref base.
Signed-off-by: Richard Maw <richard.maw@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
resolve_ref_unsafe() can't be told to be namespace aware,
so we need to prepend the namespace beforehand.
Additionally, we need to add the RESOLVE_REF_NO_RECURSE flag,
since otherwise if the commit that is pointed to exists in the root namespace,
it will opt to return that rather than the value in the namespace,
presumably preferring shorter ref names to longer ones.
Signed-off-by: Richard Maw <richard.maw@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This causes all ref resolving to look for the requested branch
inside the current namespace.
Previously any form of git revision would be accepted,
but ref resolving isn't namespace aware
and it would be infeasible to replicate all its behaviour,
so we stick to providing the most common cases
of a sha1, an absolute ref, or a partial ref.
Signed-off-by: Richard Maw <richard.maw@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This causes any namespace-aware code
to only handle refs under that namespace.
Currently this doesn't do much
as the only namespace aware code is in recieve-pack and upload-pack,
which are not handled by CGit.
Signed-off-by: Richard Maw <richard.maw@gmail.com>
|
|
|
|
|
|
|
|
|
| |
This is not strictly necessary,
as we do not have any way to generate namespace entries from a scan-path,
but I'd rather not leave this as a surprise
to someone who comes up with a good namespace discovery mechanism.
Signed-off-by: Richard Maw <richard.maw@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This contains the unexpanded name of the namespace
rather than the base ref of the namespace,
since the git namespace mechanism works by setting GIT_NAMESPACE
and on the first call to get_git_namespace() it gets expanded.
We need to save this for a later call to prepare_repo_cmd,
rather than trying to process it here,
since we can only do it once,
and we have other uses for the unexpanded name.
Signed-off-by: Richard Maw <richard.maw@gmail.com>
|
|
|
|
|
|
|
| |
This will later be changed to include namespace resolution,
but the call sites are changed now to keep the changes small.
Signed-off-by: Richard Maw <richard.maw@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The get_ref_from_filename function is expected to return a sha1.
It didn't actually do this,
instead returning the ref that would under normal circumstances resolve to that.
Since we're going to resolve refs in a way that is namespace aware
we need to return the sha1 rather than the ref,
since the archive is created by libgit code that is not namespace aware,
and it would try to resolve the ref again.
This previously worked fine
because it would resolve the ref the same way both times.
Signed-off-by: Richard Maw <richard.maw@gmail.com>
|
|
This is run soon before exiting so it wasn't leaked for long.
Signed-off-by: Richard Maw <richard.maw@gmail.com>
|