Commit Graph

6560 Commits

Author SHA1 Message Date
Carlos Martín Nieto
5c8096c53c Add a few projects to the list 2014-03-17 19:44:07 +01:00
Carlos Martín Nieto
4b7e1b9e92 refs: append to the HEAD reflog when updating the current branch
When we update the current branch, we must also append to HEAD's reflog
to keep them in sync.

This is a bit of a hack, but as git.git says, it covers 100% of
default cases.
2014-03-17 17:47:47 +01:00
Carlos Martín Nieto
cb562c3fb3 repo: remove test which deletes HEAD
This is not something anybody would ever do; removing HEAD makes the
.git/ directory no longer be a repository, so we wouldn't be expected to
handle such a situation.
2014-03-17 17:47:47 +01:00
Carlos Martín Nieto
853b1407c0 branch: constness fixes 2014-03-17 17:47:46 +01:00
Carlos Martín Nieto
2b40390f22 refs: fix copy-paste doc error 2014-03-13 15:54:53 +01:00
Edward Thomson
e59e712f64 Merge pull request #2184 from libgit2/rb/fix-revwalk-order-regression
Fix pqueue sort boundary condition bug
2014-03-12 12:05:35 -07:00
Russell Belfer
5302a88538 Fix pqueue sort boundary condition bug
If the pqueue comparison fn returned just 0 or 1 (think "a<b")
then the sort order of returned items could be wrong because there
was a "< 0" that really needed to be "<= 0".  Yikes!!!
2014-03-12 11:21:55 -07:00
Jiri Pospisil
eb46fb2ba9 Add failing test for git_object_short_id 2014-03-10 11:35:14 -07:00
Russell Belfer
8949907887 Fix a number of git_odb_exists_prefix bugs
The git_odb_exists_prefix API was not dealing correctly when a
later backend returned GIT_ENOTFOUND even if an earlier backend
had found the object.

Additionally, the unit tests were not properly exercising the API
and had a couple mistakes in checking the results.

Lastly, since the backends are not expected to behavior correctly
unless all bytes of the short id are zero except for the prefix,
this makes the ODB prefix APIs explicitly clear out the extra
bytes so the user doesn't have to be as careful.
2014-03-10 11:34:50 -07:00
Carlos Martín Nieto
9af14886a9 MSVC is silly 2014-03-10 18:20:47 +01:00
Vicent Marti
fc78488b3d Merge pull request #2175 from Yogu/submodule-resolve-url
Add git_submodule_resolve_url()
2014-03-10 18:16:56 +01:00
Jan Melcher
52fba18f4e Add git_submodule_resolve_url() 2014-03-10 18:16:10 +01:00
Paul Betts
4a8692f633 Merge pull request #2177 from shiftkey/typo-fix
corrected typo in error message
2014-03-09 21:07:18 -07:00
Brendan Forster
0782c89ed5 corrected typo in error message 2014-03-10 14:40:07 +11:00
Vicent Marti
6de018bbf1 Merge pull request #2170 from ethomson/clar
Update clar to e1990d6
2014-03-07 20:00:20 +01:00
Edward Thomson
dd954a3735 Update clar to e1990d6 2014-03-07 10:53:00 -08:00
Vicent Marti
041cd4a23f Merge pull request #2028 from libgit2/options-names
Rename options structures
2014-03-07 19:02:58 +01:00
Russell Belfer
5a6de908f6 Merge pull request #2153 from mekishizufu/tag_example
Add a tag example
2014-03-07 09:13:43 -08:00
Vicent Marti
628edd6b1b Merge pull request #2167 from mekishizufu/memory_access_fixes
Fun with memory access
2014-03-07 16:26:58 +01:00
Vicent Marti
0d95f6ec76 Merge pull request #2169 from libgit2/valgrind
Plug leaks
2014-03-07 16:26:51 +01:00
Carlos Martín Nieto
ae32c54e58 Plug a few leaks in the tests 2014-03-07 16:03:15 +01:00
Carlos Martín Nieto
a07b169834 branch: fix leak when checking against HEAD
We look up a reference in order to figure out if it's the current
branch, which we need to free once we're done with the check.

As a bonus, only perform the check when we're passed the force flag, as
it's a useless check otherwise.
2014-03-07 16:03:10 +01:00
Carlos Martín Nieto
7c1ee212b7 commit: simplify and correct refcounting in nth_gen_ancestor
We can make use of git_object_dup to use refcounting instead of pointer
comparison to make sure we don't free the caller's object.

This also lets us simplify the case for '~0' which is now just an
assignment instead of looking up the object we have at hand.
2014-03-07 16:03:10 +01:00
Carlos Martín Nieto
5187b609ba local transport: catch double-opens
Combinations of connect + fetch can call local_open multiple
times. Detect this and skip the initialization stage.
2014-03-07 16:03:10 +01:00
Jiri Pospisil
79aa03020d blame: Fix compare function's data types
Previously the hunk_byfinalline_search_cmp function was called with different
data types (size_t and uint32_t) for the key argument but expected only the
former resulting in an invalid memory access when passed the latter on a 64 bit
machine.

The following patch makes sure that the function is called and works with the
same type (size_t).
2014-03-07 15:52:34 +01:00
Jiri Pospisil
00258cc0b6 git_oid_fromstrn: Simplify the implementation and fix memory access issues 2014-03-07 15:52:27 +01:00
Vicent Marti
c81e4adfd7 Merge pull request #2168 from ethomson/clar
Update clar to a0b00f0
2014-03-07 14:00:59 +01:00
Edward Thomson
806571f352 Update clar to a0b00f0 2014-03-07 00:28:18 -08:00
Ben Straub
aa17c3c63c git_revert_opts -> git_revert_options 2014-03-06 09:44:52 -08:00
Ben Straub
6affd71f33 git_checkout_opts -> git_checkout_options 2014-03-06 09:44:51 -08:00
Carlos Martín Nieto
8e52472037 tests: MSVC compat
MSVC doesn't like declaring variables in the middle of a block, so make
sure we only declare variables at the beginning of a block.
2014-03-06 16:56:46 +01:00
Vicent Marti
4a759bfbcf Merge pull request #2165 from libgit2/revert-1997
Revert pull request #1997
2014-03-06 16:08:36 +01:00
Vicent Marti
2ab6d2cd47 Revert pull request #1997 2014-03-06 16:08:17 +01:00
Vicent Marti
4d116c3413 Merge pull request #1997 from mgbowen/merge-options-init-fix
Fix GIT_MERGE_OPTS_INIT on MSVC.
2014-03-06 16:08:12 +01:00
Vicent Marti
efc822ef0d Merge pull request #2014 from mgbowen/cpp-options-init
Function-based options initializers
2014-03-06 13:14:15 +01:00
Ben Straub
a5139485f7 Merge pull request #2162 from sunheehnus/dev
examples/diff:Add the shortstat flag to examples/diff.c
2014-03-05 19:50:23 -08:00
Sun He
6246de93b6 Merge completed: resolve the conflict with the upstream 2014-03-06 11:16:36 +08:00
Matthew Bowen
b9f819978c Added function-based initializers for every options struct.
The basic structure of each function is courtesy of arrbee.
2014-03-05 21:49:23 -05:00
Vicent Marti
a064dc2d0b Merge pull request #2159 from libgit2/rb/odb-exists-prefix
Add ODB API to check for existence by prefix and object id shortener
2014-03-06 00:47:05 +01:00
Russell Belfer
26875825df Check short OID len in odb, not in backends 2014-03-05 13:06:22 -08:00
Vicent Marti
a62ad3c353 Merge pull request #2164 from libgit2/cmn/refs-delete-iteration
refdb: catch a directory disappearing
2014-03-05 21:07:20 +01:00
Vicent Marti
967d3f2e3e Merge pull request #2163 from ethomson/nobackend_odb_write
ODB writing fails gracefully when unsupported
2014-03-05 21:06:59 +01:00
Carlos Martín Nieto
a213a7bfa8 refdb: catch a directory disappearing
If a directory disappears between the time we look up the entries of its
parent and the time when we go to look at it, we should ignore the error
and move forward.

This fixes #2046.
2014-03-05 21:00:15 +01:00
Edward Thomson
7bd2f40154 ODB writing fails gracefully when unsupported
If no ODB backends support writing, we should fail gracefully.
2014-03-05 11:35:47 -08:00
Jiri Pospisil
feebe6150f Move all variable declarations to the top of the block 2014-03-05 20:31:15 +01:00
Jiri Pospisil
a53b858417 Add tag example 2014-03-05 20:31:15 +01:00
Jiri Pospisil
4ae4a9bbd1 Fix typo 2014-03-05 20:31:15 +01:00
Sun He
8384a50a21 fix the output format of diff 2014-03-05 20:33:20 +08:00
Sun He
45d2e8dc46 Add the --shortstat flag to examples/diff.c 2014-03-05 20:13:34 +08:00
Vicent Marti
68581754f3 Merge pull request #2160 from modocache/examples-diff-add-patience-and-minimal
examples/diff: Add minimal, patience diff options.
2014-03-05 11:42:50 +01:00