Edward Thomson
d9fdee6e4c
Remove git_merge_result
as it's now unnecessary
2014-03-20 09:25:09 -07:00
Edward Thomson
5aa2ac6de1
Update git_merge_tree_opts to git_merge_options
2014-03-20 09:25:08 -07:00
Edward Thomson
02105a27f0
Change signature of git_merge
to take merge and checkout opts
2014-03-20 09:25:07 -07:00
Edward Thomson
1c0b6a38ba
Remove fastforward / uptodate from git_merge
2014-03-20 09:25:06 -07:00
Edward Thomson
ccb308273a
Add git_merge_status
to provide info about an upcoming merge
2014-03-20 09:25:06 -07:00
Edward Thomson
05d47768ca
Introduce git_merge_file for consumers
2014-03-20 09:25:05 -07:00
Carlos Martín Nieto
99797c96cd
reflog: handle symref chains
...
Given HEAD -> master -> foo, when updating foo's reflog we should also
update HEAD's, as it's considered the current branch.
2014-03-19 18:14:35 +01:00
Carlos Martín Nieto
6aaae94a70
reflog: handle the birth of a branch
...
The reflog append function was overzealous in its checking. When passed
an old and new ids, it should not do any checking, but just serialize
the data to a reflog entry.
2014-03-19 16:52:20 +01:00
Carlos Martín Nieto
1afe140043
refdb: don't update when there's no need
...
If the caller wants to update a ref to point to the same target as it
currently has, we should return early and avoid writing to the reflog.
2014-03-19 15:54:33 +01:00
Carlos Martín Nieto
bac95e6e1e
reflog: more comprehensive HEAD tests
...
The existing ones lack checking zeroed ids when switching back from an
unborn branch as well as what happens when detaching.
The reflog appending function mistakenly wrote zeros when dealing with a
detached HEAD. This explicitly checks for those situations and fixes
them.
2014-03-18 19:58:52 +01:00
Aimeast
0aee025bef
Implement git_merge_base_octopus
2014-03-18 22:31:14 +08: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
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
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
Carlos Martín Nieto
ae32c54e58
Plug a few leaks in the tests
2014-03-07 16:03:15 +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
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
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
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
Russell Belfer
13f7ecd7b9
Add git_object_short_id API to get short id string
...
This finds a short id string that will unambiguously select the
given object, starting with the core.abbrev length (usually 7)
and growing until it is no longer ambiguous.
2014-03-04 16:23:28 -08:00
Russell Belfer
f5753999e4
Add exists_prefix to ODB backend and ODB API
2014-03-04 15:34:23 -08:00
Jacques Germishuys
4636ca9391
Remove ignored files from the working directory if they were stashed
2014-03-04 12:22:27 +02:00
Matthias Bartelmeß
d113791d8f
Added a test, that fails for #2133
2014-03-03 16:10:29 +01:00
Vicent Marti
ebb3c506fd
features: Rename _HAS_
to _FEATURE_
2014-03-03 12:40:25 +01:00
Vicent Marti
c9f5298b0e
caps: Rename to features to avoid confusion
2014-03-03 12:10:36 +01:00
Ben Straub
494be429ad
Merge pull request #2144 from linquize/branch-f-current
...
Do not allow git_branch_create() to force update branch
2014-03-02 09:00:00 -06:00
Linquize
1d08b72e4f
Add unit test to show git_branch_create() fails if attempt to force create current branch
2014-03-02 19:14:20 +08:00
Russell Belfer
6789b7a75d
Add buffer to buffer diff and patch APIs
...
This adds `git_diff_buffers` and `git_patch_from_buffers`. This
also includes a bunch of internal refactoring to increase the
shared code between these functions and the blob-to-blob and
blob-to-buffer APIs, as well as some higher level assert helpers
in the tests to also remove redundancy.
2014-02-27 14:13:22 -08:00
Ben Straub
1574d3884f
Merge pull request #2137 from jru/blame-first-parent
...
Blame first-parent history
2014-02-26 16:58:20 -05:00
Juan Rubén
0276f0f55b
Reset num_parents to 1 only for merge commits
...
Also, correct test case to account for the boundary flag
2014-02-26 19:25:07 +01:00
Edward Thomson
83634d38be
Move system directory cache out of utils
2014-02-24 17:52:38 -08:00
Ben Straub
0d8265c8af
Staticize file-local variables
2014-02-24 05:32:05 -08:00
Juan Rubén
9e3b901aeb
Add unit test
2014-02-24 00:09:29 +01:00
Russell Belfer
72556cc63b
Address PR comments
...
* Make GIT_INLINE an internal definition so it cannot be used in
public headers
* Fix language in CONTRIBUTING
* Make index caps API use signed instead of unsigned values
2014-02-20 14:27:10 -08:00
Ben Straub
9bda5fb8c1
Improve error propagation in shallow call
2014-02-18 14:05:30 -08:00
Edward Thomson
2a528bc088
Fix filter test for CRLF->LF issues
2014-02-11 19:05:52 -06:00
Russell Belfer
5d195cf76b
Merge pull request #2110 from libgit2/ed/crlf_input
...
Handle `core.autocrlf=input` when checking out
2014-02-11 15:56:04 -08:00
Carlos Martín Nieto
15284a2c5a
refs: move current_id before the reflog parameters
...
Keep the reflog parameters as the last two, as they're the optional
parameters.
2014-02-10 14:52:28 +01:00
Edward Thomson
9780020b18
Tests for crlf filtering into the repository
2014-02-09 13:45:39 -08:00
Edward Thomson
f77127da12
Tests for core.autocrlf and .gitattributes
2014-02-09 13:45:38 -08:00
Edward Thomson
fb6f4539d1
Close files on file diff failure
...
Not closing the files on a diff failure ensures that clar
cleanup will fail on win32 because we still have the file open.
2014-02-09 13:45:36 -08:00
Russell Belfer
80c29fe93e
Add git_commit_amend API
...
This adds an API to amend an existing commit, basically a shorthand
for creating a new commit filling in missing parameters from the
values of an existing commit. As part of this, I also added a new
"sys" API to create a commit using a callback to get the parents.
This allowed me to rewrite all the other commit creation APIs so
that temporary allocations are no longer needed.
2014-02-07 16:17:59 -08:00
Russell Belfer
2d9291943c
Merge pull request #2099 from libgit2/bs/more-reflog-stuff
...
More reflogness
2014-02-07 16:14:17 -08:00
Russell Belfer
57c47af107
Merge pull request #2042 from libgit2/cmn/conditional-ref
...
refs: conditional ref updates
2014-02-07 16:05:19 -08:00
Russell Belfer
3158e2febe
Fix some Windows warnings
...
This fixes a number of warnings with the Windows 64-bit build
including a test failure in test_repo_message__message where an
invalid pointer to a git_buf was being used.
2014-02-07 15:43:37 -08:00
Vicent Marti
c4ee3b54f8
Merge pull request #2100 from libgit2/rb/update-pqueue
...
Replace priority queue code with implementation from hashsig
2014-02-07 18:32:06 +01:00
Ben Straub
db55bb73ff
Correct default reflog message for git_remote_fetch
2014-02-06 11:18:10 -08:00
Ben Straub
5dae3ffe25
Only run clone-failure test on private repo
2014-02-05 19:27:27 -08:00
Ben Straub
78ee7e81f5
More merge.conflictstyle fixes
2014-02-05 14:10:19 -08:00
Ben Straub
3094102f69
Avoid crash when skipping remote test
2014-02-05 14:05:18 -08:00
Ben Straub
fe45922d77
Fix broken clone test
2014-02-05 13:41:12 -08:00
Ben Straub
a2ce19ca68
Prevent user's merge.conflictstyle from breaking tests
2014-02-05 13:35:26 -08:00
Ben Straub
5c8be32559
Fix a few references to changed function signatures
2014-02-05 13:32:45 -08:00
Ben Straub
0de2c4e3a3
Merge remote-tracking branch 'libgit2/development' into bs/more-reflog-stuff
2014-02-05 13:15:57 -08:00
Ben Straub
629ba7f105
Merge pull request #2027 from libgit2/rb/only-windows-is-windows
...
Some tests of paths that can't actually be written to disk
2014-02-05 13:07:46 -08:00
Carlos Martín Nieto
d18209eef9
revwalk: add a test for pushing all references
...
This used to be broken, let's make sure we don't break this use-case.
2014-02-05 12:16:44 +01:00
Carlos Martín Nieto
d465e4e980
revwalk: ignore wrong object type in glob pushes
...
Pushing a whole namespace can cause us to attempt to push non-committish
objects. Catch this situation and special-case it for ignoring this.
2014-02-05 12:16:44 +01:00
Carlos Martín Nieto
b4ef67d5eb
revwalk: add a failing test for pushing "tags"
...
This shows that pusing a whole namespace can be problematic.
2014-02-05 12:16:37 +01:00
Carlos Martín Nieto
5367ec4b84
refs: add an unconditional delete
...
Add it under the git_reference_remove() name, letting the user pass the
repo and name, analogous to unconditional setting/creation.
2014-02-05 12:07:57 +01:00
Carlos Martín Nieto
b7ae71ecf2
refs: catch cases where the ref type has changed
...
If the type of the on-disk reference has changed, the old value
comparison should fail.
2014-02-05 12:07:57 +01:00
Carlos Martín Nieto
f44fd59ed7
refs: check the ref's old value when deleting
...
Recognize when the reference has changed since we loaded it.
2014-02-05 12:07:57 +01:00
Carlos Martín Nieto
878fb66f57
refs: bring conditional symbolic updates to the frontend
...
Bring the race detection goodness to symbolic references as well.
2014-02-05 12:07:57 +01:00
Carlos Martín Nieto
d6236cf662
refs: add tests for conditional updates
2014-02-05 12:07:56 +01:00
Ben Straub
010cec3ac2
Add reflog params to git_repository_detach_head
2014-02-04 20:50:40 -08:00
Ben Straub
c3ab1e5af4
Add reflog parameters to remote apis
...
Also added a test for git_remote_fetch.
2014-02-04 20:38:13 -08:00
Ben Straub
491cecfe8c
Add reflog parameters to git_push_update_tips
2014-02-04 20:27:44 -08:00
Ben Straub
0adb06065b
Fix reflog message when creating commits
2014-02-04 15:32:57 -08:00
Russell Belfer
43709ca878
Fix typo setting sorted flag when reloading index
...
This fixes a typo I made for setting the sorted flag on the index
after a reload. That typo didn't actually cause any test failures
so I'm also adding a test that explicitly checks that the index is
correctly sorted after a reload when ignoring case and when not.
2014-02-04 10:33:30 -08:00
Russell Belfer
882c774271
Convert pqueue to just be a git_vector
...
This updates the git_pqueue to simply be a set of specialized
init/insert/pop functions on a git_vector.
To preserve the pqueue feature of having a fixed size heap, I
converted the "sorted" field in git_vectors to a more general
"flags" field so that pqueue could mix in it's own flag. This
had a bunch of ramifications because a number of places were
directly looking at the vector "sorted" field - I added a couple
new git_vector helpers (is_sorted, set_sorted) so the specific
representation of this information could be abstracted.
2014-02-04 10:01:37 -08:00
Russell Belfer
af4bc6615d
Add some priority queue tests
...
I forgot that I wrote some tests for the new priority queue code.
2014-02-03 21:04:40 -08:00
Edward Thomson
bb13d39162
Test that emulates a strange filter implementation
2014-02-03 19:56:34 -08:00
Edward Thomson
16eb8b7c06
Tests merging staged files identical to result
2014-02-03 19:56:34 -08:00
Edward Thomson
b60149eced
Tests merge when changes exist in workdir/index
2014-02-03 19:56:33 -08:00
Ben Straub
86746b4b3a
Add reset tests for reflog
2014-02-03 15:06:47 -08:00
Ben Straub
eec2761f06
Fix warning
2014-02-03 15:06:32 -08:00
Ben Straub
586be3b889
Add reflog parameters to git_reset
2014-02-03 15:05:55 -08:00
Ben Straub
0d847a3159
Reset helpers: use revparse instead
2014-02-03 14:08:40 -08:00
Vicent Marti
3b6a5bac20
Merge pull request #2095 from libgit2/update-head-reflog
...
Correct "new" id for reattached-HEAD reflog entry
2014-02-03 10:36:04 -08:00
Arthur Schreiber
50ad7cc208
Add git_reference_is_note
.
2014-02-02 18:20:38 +01:00
Ben Straub
7ac1b89942
Add failing test case
2014-02-01 11:46:15 -08:00
Russell Belfer
7be88b4c4d
Update to latest clar
2014-01-31 13:44:09 -08:00
Ben Straub
db092c1955
Allow tests to run without user config
2014-01-30 16:10:18 -08:00
Ben Straub
a1710a28f6
Enhance testing of signature parameters
2014-01-30 15:53:52 -08:00
Ben Straub
59bb1126e0
Provide good default reflog messages in branch api
2014-01-30 15:53:52 -08:00
Ben Straub
e871d89b28
Ensure moving a branch updates the reflog
2014-01-30 15:52:14 -08:00
Ben Straub
ccf6ce5c89
Ensure renaming a reference updates the reflog
2014-01-30 15:52:13 -08:00
Ben Straub
540c1809f4
Add reflog parameters to git_branch_move
2014-01-30 15:52:13 -08:00
Ben Straub
48110f67e4
Deleting a branch deletes its reflog
2014-01-30 15:52:13 -08:00
Ben Straub
1cc974ab62
Augment clone API with reflog parameters
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
Ben Straub
67c4716f74
Add passing reflog tests
2014-01-30 15:51:00 -08:00
Ben Straub
2952a9d0f4
Ensure creating HEAD creates its reflog
2014-01-30 15:51:00 -08:00