Carlos Martín Nieto
82374d9825
branch: add getter for the upstream remote name
...
This gets the value from branch.<foo>.remote.
2014-11-08 20:00:17 +01:00
Sven Strickroth
fa13ee2d7c
Add GIT_BRANCH_ALL to git_branch_t enum
...
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 a667ca8298
(PR #1946 ).
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2014-04-16 18:51:16 +02:00
Jacques Germishuys
3b4ba27870
Const correctness!
2014-04-03 16:06:31 +02:00
Carlos Martín Nieto
853b1407c0
branch: constness fixes
2014-03-17 17:47:46 +01:00
Ben Straub
a1b07dca7d
Document branch-creation reflog better
2014-01-30 15:53:52 -08:00
Ben Straub
540c1809f4
Add reflog parameters to git_branch_move
2014-01-30 15:52:13 -08:00
Ben Straub
b31ebfbc66
Add reflog params to git_branch_create
2014-01-30 15:52:13 -08:00
Carlos Martín Nieto
b25d87c9cd
branch: move to git_buf when outputting newly-allocated strings
...
Internally we already did everything with git_bufs, so this is just
exposing those functions with public names.
2014-01-27 04:44:05 +01:00
Arthur Schreiber
a667ca8298
Change the git_branch_iterator_new and git_branch_next definitions to use git_branch_t.
2013-11-05 20:51:07 +01:00
Carlos Martín Nieto
8ec889a45f
branch: move from foreach to an iterator
...
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.
2013-11-05 14:58:16 +01:00
Daniel Rodríguez Troitiño
f8bd730cd9
Fix documentation of git_branch_delete.
...
The reference should be freed by the user, not the library.
2013-05-26 17:29:00 +02:00
Nikolai Vladimirov
72662202ac
branch.h: fix typo in docs
2013-05-06 15:31:26 +03:00
Vicent Martí
ea8bac37b0
Merge pull request #1450 from carlosmn/branch-upstream
...
Branch upstream configuration
2013-04-11 06:34:59 -07:00
Carlos Martín Nieto
d59942c2ab
branch: add more upstream configuration management
...
Add functions to set and unset the upstream configuration to
complement the getter we already have.
2013-04-11 12:27:25 +02:00
nulltoken
b08c317346
branch: Fix git_branch_create() documentation
2013-04-01 22:01:13 +02:00
Carlos Martín Nieto
a258d8e357
branch: rename 'tracking' to 'upstream'
...
The term 'tracking' is overloaded. Help distinguish what we mean by
using 'upstream' for this part of the library.
2013-03-30 15:45:57 +01:00
Edward Thomson
d00d54645d
immutable references and a pluggable ref database
2013-03-07 11:01:52 -06:00
nulltoken
c1b5e8c42b
branch: Make git_branch_remote_name() cope with orphaned heads
2013-02-22 17:04:23 +01:00
Jameson Miller
2e3e8c889b
Teach remote branch to return its remote
2013-02-11 11:36:22 -05:00
Sebastian Bauer
c253056d24
Added git_branch_name().
...
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.
2013-01-25 05:24:21 +01:00
nulltoken
bf031581d3
branch: Introduce git_branch_tracking_name()
2013-01-16 22:56:13 +01:00
Edward Thomson
359fc2d241
update copyrights
2013-01-08 17:31:27 -06:00
nulltoken
621730383a
branch: Deploy EINVALIDSPEC usage
2012-12-01 08:34:28 +01:00
Vicent Marti
cfbe4be3fb
More external API cleanup
...
Conflicts:
src/branch.c
tests-clar/refs/branches/create.c
2012-11-27 13:18:27 -08:00
nulltoken
0c78f685eb
branch: introduce git_branch_is_head()
2012-10-07 21:03:51 +02:00
Vicent Marti
c9d223f0de
branch: Add missing include
2012-09-04 22:57:31 +02:00
Vicent Marti
62eafd0620
Merge branch 'branch-delete-ref' into development
...
Conflicts:
include/git2/refs.h
2012-08-27 14:54:52 -07:00
Vicent Marti
1c947daa80
branch: Change git_branch_delete
to take a ref
2012-08-26 18:00:10 -07:00
Vicent Marti
51e1d80846
Merge remote-tracking branch 'arrbee/tree-walk-fixes' into development
...
Conflicts:
src/notes.c
src/transports/git.c
src/transports/http.c
src/transports/local.c
tests-clar/odb/foreach.c
2012-08-06 12:41:08 +02:00
Russell Belfer
5dca201072
Update iterators for consistency across library
...
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.
2012-08-03 17:08:01 -07:00
Vicent Marti
f0244463ad
branch: Add repository
argument to create
...
Yes, we can get the repository from the owner of the object, but having
it marked explicitly makes the API more consistent.
2012-07-27 18:49:37 +02:00
nulltoken
fb910281d6
branch: introduce git_branch_tracking()
2012-07-24 16:09:48 +02:00
nulltoken
bf9e8cc86b
branch: make git_branch_move() reference based
2012-07-24 16:09:47 +02:00
nulltoken
abee7bd36a
branch: slight git_branch_create() doc improvement
2012-07-24 16:09:46 +02:00
nulltoken
eed378b669
branch: introduce git_branch_lookup()
2012-07-24 16:09:44 +02:00
nulltoken
b308c11e4e
branch: change git_branch_create() to make it return a reference
2012-07-24 16:09:43 +02:00
nulltoken
d4827081ea
branch: drop git_branch_list()
2012-06-21 18:51:32 +02:00
nulltoken
a8fd805e2f
branch: add git_branch_foreach()
2012-06-21 18:51:27 +02:00
Vicent Martí
904b67e69f
errors: Rename error codes
2012-05-18 01:48:50 +02:00
Vicent Martí
e172cf082e
errors: Rename the generic return codes
2012-05-18 01:26:26 +02:00
Vicent Martí
2e2e97858d
Properly tag all enums
with a _t
2012-05-18 01:26:23 +02:00
Carlos Martín Nieto
1a2b87257d
Typedefs don't have enum in front
2012-04-11 14:27:40 +02:00
nulltoken
4615f0f71b
branch: add git_branch_move()
2012-04-10 21:39:06 +02:00
nulltoken
731df57080
Add basic branch management API: git_branch_create(), git_branch_delete(), git_branch_list()
2012-04-10 21:39:03 +02:00
schu
5e0de32818
Update Copyright header
...
Signed-off-by: schu <schu-github@schulog.org>
2012-02-13 17:11:09 +01:00
Vicent Marti
bb742ede3d
Cleanup legal data
...
1. The license header is technically not valid if it doesn't have a
copyright signature.
2. The COPYING file has been updated with the different licenses used in
the project.
3. The full GPLv2 header in each file annoys me.
2011-09-19 01:54:32 +03:00
Carlos Martín Nieto
9c82357be7
Add a remotes API
...
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-06-26 18:18:10 +02:00