| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Signed-off-by: Sven Strickroth <email@cs-ware.de>
|
|
|
| |
Signed-off-by: Remy Suen <remy.suen@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
As git_reference__name will reallocate storage to account for longer
names (it's actually allocator-dependent), it will cause all existing
pointers to the old object to become dangling, as they now point to
freed memory.
Fix the issue by renaming to a more descriptive name, and pass a pointer
to the actual reference that can safely be invalidated if the realloc
succeeds.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Implement a new function that is able to determine if a branch is
checked out in any repository connected to the current
repository. In particular, this is required to check if for a
given repository and branch, there exists any working tree
connected to that repository that is referencing this branch.
|
|
|
|
|
|
|
| |
We do not always want to put the id directly into the reflog, but we
want to speicfy what a user typed. For this use-case we provide
annotated version of a few functions which let the caller specify what
user-friendly name was used when asking for the operation.
|
|
|
|
|
|
|
| |
This namespace is about behaving like git's branch command, so let's do
exactly that instead of taking a reflog message.
This override is still available via the reference namespace.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
This gets the value from branch.<foo>.remote.
|
|
|
|
|
|
|
|
| |
git_branch_t is an enum so requesting GIT_BRANCH_LOCAL | GIT_BRANCH_REMOTE is not possible as it is not a member of the enum (at least VS2013 C++ complains about it).
This fixes a regression introduced in commit a667ca8298193b3103c1dbdcb1f6c527e6e99eb2 (PR #1946).
Signed-off-by: Sven Strickroth <email@cs-ware.de>
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Internally we already did everything with git_bufs, so this is just
exposing those functions with public names.
|
|
|
|
| |
git_branch_t.
|
|
|
|
|
|
|
|
| |
Create a git_branch_iterator type which is equivalent to the foreach but
lets us write loops instead of callbacks.
Since the introduction of git_reference_shorthand(), the added value of
passing the name is reduced.
|
|
|
|
| |
The reference should be freed by the user, not the library.
|
| |
|
|\
| |
| | |
Branch upstream configuration
|
| |
| |
| |
| |
| | |
Add functions to set and unset the upstream configuration to
complement the getter we already have.
|
| |
| |
| |
| |
| | |
The term 'tracking' is overloaded. Help distinguish what we mean by
using 'upstream' for this part of the library.
|
|/ |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
This is a convenience function to get the branch name of a given
ref. The returned branch name is compatible with the name that can
be supplied e.g. to git_branch_lookup(). That is, the prefixes
"refs/heads" or "refs/remotes" are omitted.
Also added a new test for testing the new function.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Conflicts:
src/branch.c
tests-clar/refs/branches/create.c
|
| |
|
| |
|
|\
| |
| |
| |
| | |
Conflicts:
include/git2/refs.h
|
|/ |
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/notes.c
src/transports/git.c
src/transports/http.c
src/transports/local.c
tests-clar/odb/foreach.c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This updates all the `foreach()` type functions across the library
that take callbacks from the user to have a consistent behavior.
The rules are:
* A callback terminates the loop by returning any non-zero value
* Once the callback returns non-zero, it will not be called again
(i.e. the loop stops all iteration regardless of state)
* If the callback returns non-zero, the parent fn returns GIT_EUSER
* Although the parent returns GIT_EUSER, no error will be set in
the library and `giterr_last()` will return NULL if called.
This commit makes those changes across the library and adds tests
for most of the iteration APIs to make sure that they follow the
above rules.
|
| |
| |
| |
| |
| | |
Yes, we can get the repository from the owner of the object, but having
it marked explicitly makes the API more consistent.
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|