Commit Graph

56 Commits

Author SHA1 Message Date
Mohammed Bilal
e579e0f707 New upstream version 1.4.3+dfsg.1 2022-05-05 10:45:21 +00:00
Pirate Praveen
c25aa7cd82 New upstream version 1.3.0+dfsg.1 2021-12-10 16:42:08 +05:30
Utkarsh Gupta
22a2d3d5ef New upstream version 1.1.0+dfsg.1 2020-12-07 04:06:37 +05:30
Jongmin Kim
ac3d33df5d New upstream version 0.28.1+dfsg.1 2019-05-12 00:29:21 +09:00
Patrick Steinhardt
e3acd37b70 branch: implement git_branch_is_checked_out
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.
2017-02-13 11:04:57 +01:00
Carlos Martín Nieto
62d38a1ddb Add annotated commit versions of reflog-modifying functions
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.
2015-03-16 16:57:30 +01:00
Carlos Martín Nieto
6bfb990dc7 branch: don't accept a reflog message override
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.
2015-03-03 14:40:50 +01:00
Carlos Martín Nieto
659cf2029f Remove the signature from ref-modifying functions
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.
2015-03-03 14:40:50 +01:00
Will Stamper
b874629b2d Spelling fixes 2014-12-04 21:06:59 -06:00
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