Age | Commit message (Collapse) | Author |
|
Unfortunately git-core uses the term "unborn branch" and "orphan
branch" interchangeably. However, "orphan" is only really there for
the checkout command, which has the `--orphan` option so it doesn't
actually create the branch.
Branches never have parents, so the distinction of a branch with no
parents is odd to begin with. Crucially, the error messages deal with
unborn branches, so let's use that.
|
|
|
|
Thread safety for the refdb_fs
|
|
|
|
|
|
If there were symbolic refs among the loose refs then the code
to create packed-refs would fail trying to parse the OID out of
them (where Git just skips trying to pack them). This fixes it.
|
|
|
|
Fix #1722
|
|
Also fixed an assert typo on nulltoken's HEAD
|
|
This fixes problems with missing function prototypes and 64-bit
data issues on Windows.
|
|
This is a significant reorganization of the diff code to break it
into a set of more clearly distinct files and to document the new
organization. Hopefully this will make the diff code easier to
understand and to extend.
This adds a new `git_diff_driver` object that looks of diff driver
information from the attributes and the config so that things like
function content in diff headers can be provided. The full driver
spec is not implemented in the commit - this is focused on the
reorganization of the code and putting the driver hooks in place.
This also removes a few #includes from src/repository.h that were
overbroad, but as a result required extra #includes in a variety
of places since including src/repository.h no longer results in
pulling in the whole world.
|
|
Breaking RefDB changes
|
|
Introduce git_reference_shorthand
|
|
|
|
|
|
Expose a way to retrieve, along with the target git_object, the reference
pointed at by some revparse expression (`@{<-n>}` or
`<branchname>@{upstream}` syntax).
|
|
|
|
There was a problem found in the Rugged test suite where the
refdb_fs_backend__next function could exit too early in some
very specific hashing patterns for packed refs. This ports
the Rugged test to libgit2 and then fixes the bug.
|
|
Introduce a refs iterator
|
|
Nobody should ever be using anything other than ALL at this level, so
remove the option altogether.
As part of this, git_reference_foreach_glob is now implemented in the
frontend using an iterator. Backends will later regain the ability of
doing the glob filtering in the backend.
|
|
Selecting wether to list loose or packed references is not something
we want to support anymore, so remove a test for this.
|
|
|
|
This allows us to get a list of reference names in a loop instead of callbacks.
|
|
|
|
Generate a shorthand name out of the full refname.
|
|
Currently git_branch_set_upstream when passed a local branch
creates invalid configuration, for ex. if we setup branch
'tracking_master' to track local 'master' libgit2 generates
the following config
```
[branch "track_master"]
remote = .
merge = .refs/heads/track_master
```
The merge value is invalid and calling git_branch_upstream on
'tracking_master' results in invalid reference error.
It should do:
```
[branch "track_master"]
remote = .
merge = refs/heads/master
```
|
|
Make sure error messages are set for most error returns
|
|
Older versions of git would only write peeled entries for
items under refs/tags/. Newer versions will write them for
all refs, and we should be prepared to handle that.
|
|
There were a couple of places where an error was being returned
from branch related code but no error message was being set.
|
|
Introduce git_remote_{fetch,push}_refspecs() to get a list of refspecs
from the remote and rename the refspec-adding functions to a less
silly name.
Use this instead of the vector index hacks in the tests.
|
|
A remote can have a multitude of refspecs. Up to now our git_remote's
have supported a single one for each fetch and push out of simplicity
to get something working.
Let the remotes and internal code know about multiple remotes and get
the tests passing with them.
Instead of setting a refspec, the external users can clear all and add
refspecs. This should be enough for most uses, though we're still
missing a querying function.
|
|
|
|
|
|
|
|
|
|
This will probably prevent many lookup/free
operations in calling code.
|
|
|
|
Branch upstream configuration
|
|
Add functions to set and unset the upstream configuration to
complement the getter we already have.
|
|
|
|
|
|
|
|
|
|
Signed-off-by: Greg Price <price@mit.edu>
|
|
|
|
Return the size we'd need to write to instead of simply an
error. Split the function into two to be used later by the upstream
configuration functions.
|
|
The term 'tracking' is overloaded. Help distinguish what we mean by
using 'upstream' for this part of the library.
|
|
This fixes various build warnings on Mac and Windows (64-bit).
|
|
|
|
It's somewhat common to try to write "/refs/tags/something". There is
no easy way to catch it during the main body of the function, as there
is no way to distinguish whether it's a leading slash or a double
slash somewhere in the middle.
Catch this at the beginning so we don't trigger the assert in
is_all_caps_and_underscore().
|