Commit Graph

7336 Commits

Author SHA1 Message Date
Carlos Martín Nieto
5451754d46 Include git2/odb_backend.h in git2.h
Since this isn't under sys/ we need to have it included in the main
git2.h file.

This fixes #2551.
2014-09-30 16:27:53 +02:00
Erdur
44802c551e path: fix invalid access 2014-09-30 16:19:24 +02:00
Carlos Martín Nieto
262eec23fe remote: accept a repository and remote name for deletion
We don't need the remote loaded, and the function extracted both of
these from the git_remote in order to do its work, so let's remote a
step and not ask for the loaded remote at all.

This fixes #2390.
2014-09-30 16:09:55 +02:00
Carlos Martín Nieto
274c3fa62e Add changelog for transactions 2014-09-30 15:52:14 +02:00
Carlos Martín Nieto
db2f82630c transaction: add documentation 2014-09-30 15:52:13 +02:00
Carlos Martín Nieto
f99ca52378 stash: use a transaction to modify the reflog
The stash is implemented as the refs/stash reference and its reflog. In
order to modify the reflog, we need avoid races by making sure we're the
only ones allowed to modify the reflog.

We achieve this via the transactions API. Locking the reference gives us
exclusive write access, letting us modify and write it without races.
2014-09-30 15:52:13 +02:00
Carlos Martín Nieto
ab8d9242f5 Introduce reference transactions
A transaction allows you to lock multiple references and set up changes
for them before applying the changes all at once (or as close as the
backend supports).

This can be used for replication purposes, or for making sure some
operations run when the reference is locked and thus cannot be changed.
2014-09-30 15:44:32 +02:00
Carlos Martín Nieto
bdeb8772fe signature: add a dup function which takes a pool
This will be used by the transaction code.
2014-09-30 15:44:32 +02:00
Carlos Martín Nieto
20363d583c reflog: constify byindex 2014-09-30 15:44:32 +02:00
Carlos Martín Nieto
c5837cad85 remote: implement opportunistic remote-tracking branch updates
When a list of refspecs is passed to fetch (what git would consider
refspec passed on the command-line), we not only need to perform the
updates described in that refspec, but also update the remote-tracking
branch of the fetched remote heads according to the remote's configured
refspecs.

These "fetches" are not however to be written to FETCH_HEAD as they
would be duplicate data, and it's not what the user asked for.
2014-09-30 15:43:24 +02:00
Carlos Martín Nieto
2cdd5c5752 remote: store passive refspecs
The configured/base fetch refspecs need to be taken into account in
order to implement opportunistic remote-tracking branch updates. DWIM
them and store them in the struct, but don't do anything with them yet.
2014-09-30 15:42:32 +02:00
Carlos Martín Nieto
c300d84a64 remote: don't DWIM refspecs unnecessarily
We can only DWIM when we've connected to the remote and have the list of
the remote's references. Adding or setting the refspecs should not
trigger an attempt to DWIM the refspecs as we typically cannot do it,
and even if we did, we would not use them for the current fetch.
2014-09-30 15:42:32 +02:00
Carlos Martín Nieto
9c206a2248 remote: use active refspec override in the tests
This lets us test this bit as well as getting closer to what they were
trying to do.
2014-09-30 15:42:32 +02:00
Carlos Martín Nieto
3f89420523 remote: allow overriding the refspecs for download and fetch
With opportunistic ref updates, git has introduced the concept of having
base refspecs *and* refspecs that are active for a particular fetch.

Let's start by letting the user override the refspecs for download.
2014-09-30 15:42:32 +02:00
Carlos Martín Nieto
a3b9270dcf describe: document the API 2014-09-30 09:32:24 +02:00
Carlos Martín Nieto
886710b77e describe: make mingw happy
The MinGW compiler does not like it when we declare a typedef twice.
2014-09-30 09:20:08 +02:00
Carlos Martín Nieto
25345c0cbe describe: rename git_describe_opts to git_describe_options
And implement the option init functions for this and the format options.
2014-09-30 09:18:22 +02:00
Carlos Martín Nieto
5431c46a96 describe: use globs in the tests
This makes us be closer to git's tests, and lets us better describe what
we expect from the output.
2014-09-30 09:05:55 +02:00
Carlos Martín Nieto
55f1b6b641 describe: implement abbreviated ids 2014-09-30 08:56:27 +02:00
Carlos Martín Nieto
fd8126e4c6 describe: implement describing the workdir
When we describe the workdir, we perform a describe on HEAD and then
check to see if the worktree is dirty. If it is and we have a suffix
string, we append that to the buffer.
2014-09-30 08:56:20 +02:00
Carlos Martín Nieto
3b6534b807 describe: split into gather and format steps
Instead of printing out to the buffer inside the information-gathering
phase, write the data to a intermediate result structure.

This allows us to split the options into gathering options and
formatting options, simplifying the gathering code.
2014-09-30 07:24:28 +02:00
Carlos Martín Nieto
1f501a086b describe: rename _object() to _commit()
We don't describe arbitrary object, so let's give it the name of the one
object type we accept.
2014-09-30 04:58:02 +02:00
Carlos Martín Nieto
af6cc38fc0 Merge remote-tracking branch 'upstream/master' into cmn/describe 2014-09-30 04:38:05 +02:00
Brendan Forster
a2a2332219 the wiki, it is dead 2014-09-30 04:17:08 +02:00
Edward Thomson
4c53489260 Merge pull request #2581 from jacquesg/stash-ignored-directories
Stash ignored directories
2014-09-29 14:57:54 -04:00
Edward Thomson
89602a1a23 Merge pull request #2584 from jacquesg/pool-alignment
Pool/Index data is not aligned
2014-09-29 10:39:40 -04:00
Edward Thomson
ffe34a7cdc Merge pull request #2582 from swansontec/master
Correctly handle getaddrinfo return result
2014-09-29 10:37:37 -04:00
Edward Thomson
ced843f417 Merge pull request #2559 from libgit2/cmn/free-tls-error
global: free the error message when exiting a thread
2014-09-29 10:29:00 -04:00
Jacques Germishuys
7b7aa75f80 Recurse ignored directories when stashing 2014-09-26 13:11:49 +02:00
Jacques Germishuys
0478b7f472 Silence unused return value warning 2014-09-26 12:12:09 +02:00
Jacques Germishuys
5387cfee4c Ensure patch is initialized to zero, otherwise, the allocated flag may be set 2014-09-26 12:12:09 +02:00
Jacques Germishuys
e640a77c9f Silence uninitialized warning 2014-09-26 12:12:08 +02:00
Jakub Čajka
7629ea5d8d Fixed odb foreach test failure for big-endian 64-bit 2014-09-26 12:12:08 +02:00
Jakub Čajka
d99e547173 Fixed merge REUC test for big-endian 64-bit 2014-09-26 12:12:08 +02:00
Jacques Germishuys
ff97778a7a The raw index buffer content is not guaranteed to be aligned
* Ensure alignment by copying the content into a structure on the stack
2014-09-26 12:12:08 +02:00
Jacques Germishuys
ad8c8d9325 Ensure pool data is aligned on an 8 byte boundary 2014-09-25 17:56:56 +02:00
Jacques Germishuys
3aaa5c7b46 Introduce GIT_ALIGN 2014-09-25 12:05:26 +02:00
Carlos Martín Nieto
cb4a956b9c Merge pull request #2570 from cirosantilli/rm-unused-var
Remove unused buf variable from path/core test.
2014-09-25 06:50:44 +02:00
William Swanson
d0cf1040c7 Correctly handle getaddrinfo return result
The getaddrinfo function indicates failure with a non-zero return code,
but this code is not necessarily negative. On platforms like Android
where the code is positive, a failed call causes libgit2 to segfault.
2014-09-24 12:01:14 -07:00
Jacques Germishuys
940da54861 Added test for stashing files in ignored directories 2014-09-24 13:24:06 +02:00
Ciro Santilli
062804570c Join typedef and struct definitions in single file. 2014-09-24 11:00:51 +02:00
Carlos Martín Nieto
2cd3cb8e03 Add a note about cert check in the CHANGELOG 2014-09-24 10:22:03 +02:00
Sven Strickroth
e6e834a129 Provide host name to certificate_check_cb
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2014-09-22 16:27:52 +02:00
Vicent Marti
14556cbff7 Merge pull request #2567 from cirosantilli/factor-41
Factor 40 and 41 constants from source.
2014-09-17 17:13:25 +02:00
Carlos Martín Nieto
6340e8f5d0 travis: another attempt at multiple allowed failures
It looks like what Travis wants is a list of hashes, rather than a hash
with a list.
2014-09-17 15:52:01 +02:00
Vicent Marti
276d9ea3a6 Merge pull request #2571 from libgit2/vmg/walk-up-path
Fix `git_path_walk_up` to work with non-rooted paths
2014-09-17 15:39:57 +02:00
The rugged tests are fragile
74240afb9c repository: Do not double-free config 2014-09-17 15:35:50 +02:00
Carlos Martín Nieto
5c22c4a205 travis: fix allowed failures list 2014-09-17 15:35:15 +02:00
Vicent Marti
4592b62ee5 Merge pull request #2572 from cirosantilli/factor-void
Replace void casts with GIT_UNUSED.
2014-09-17 15:26:48 +02:00
The rugged tests are fragile
4e96411748 Style 2014-09-17 15:24:56 +02:00