Commit Graph

58 Commits

Author SHA1 Message Date
Carlos Martín Nieto
5b05f95424 merge: work around write-side racy protection when hacking the index
As we attempt to replicate a situation in which an older checkout has
put a file on disk with different filtering settings from us, set the
timestamp on the entry and file to a second before we're performing the
operation so the entry in the index counts as old.

This way we can test that we're not looking at the on-disk file when the
index has the entry and we detect it as clean.
2015-06-22 16:11:58 +02:00
Edward Thomson
fef5344c50 merge::workdir::dirty: tick idx to defeat racy-git 2015-06-16 16:39:13 -04:00
Edward Thomson
9f545b9d71 introduce git_index_entry_is_conflict
It's not always obvious the mapping between stage level and
conflict-ness.  More importantly, this can lead otherwise sane
people to write constructs like `if (!git_index_entry_stage(entry))`,
which (while technically correct) is unreadable.

Provide a nice method to help avoid such messy thinking.
2015-05-28 09:47:31 -04:00
Edward Thomson
9ebb5a3ff3 merge: merge iterators 2015-05-11 14:11:56 -04:00
Jacques Germishuys
13de936316 Collapse whitespace flags into git_merge_file_flags_t 2015-03-16 09:53:27 +02:00
Jacques Germishuys
f29dde6828 Renamed git_merge_options 'flags' to 'tree_flags' 2015-03-16 09:53:27 +02:00
Jacques Germishuys
0f24cac2b9 Added tests to merge files and branches with whitespace problems and fixes 2015-03-16 09:53:27 +02:00
Carlos Martín Nieto
23a17803b6 reset: remove reflog message override
This function is meant to simulate what git does in the reset command,
so we should include the reflog message in that.
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
Edward Thomson
8b0ddd5dd9 merge: lock the index at the start of the merge
Always lock the index when we begin the merge, before we write
any of the metdata files.  This prevents a race where another
client may run a commit after we have written the MERGE_HEAD but
before we have updated the index, which will produce a merge
commit that is treesame to one parent.  The merge will finish and
update the index and the resultant commit would not be a merge at
all.
2015-02-14 09:25:35 -05:00
Edward Thomson
42f98a26a5 merge test: test an actual failure, not conflict
Correct the merge failed cleanup test.  Merge data should not be
cleaned up on conflicts, only on actual failure.  And ORIG_HEAD
should not be removed at all.
2015-02-13 11:44:34 -05:00
Linquize
8e0aa2ebce Fix broken merge tests due to autocrlf was not false 2014-12-07 23:41:30 +08:00
Edward Thomson
18b00406c6 s/git_merge_head/git_annotated_commit
Rename git_merge_head to git_annotated_commit, as it becomes used
in more operations than just merge.
2014-10-26 22:59:48 -04:00
Carlos Martín Nieto
0625638f06 Merge pull request #2499 from csware/hard-reset-checkout-callbacks
Allow to propagate checkout callbacks to git HARD reset
2014-10-10 17:40:53 +02:00
Vicent Marti
737b505116 hashsig: Export as a sys header 2014-10-01 12:03:24 +02:00
Jakub Čajka
d99e547173 Fixed merge REUC test for big-endian 64-bit 2014-09-26 12:12:08 +02:00
Ciro Santilli
3b2cb2c91e Factor 40 and 41 constants from source. 2014-09-16 13:07:04 +02:00
Sven Strickroth
b8add6c42e Allow to propagate checkout callbacks to git HARD reset
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2014-08-03 16:29:51 +02:00
Vicent Marti
c1bf2942fc Merge pull request #2455 from ethomson/equal_oid
Introduce `cl_assert_equal_oid`
2014-07-02 15:29:25 +02:00
Edward Thomson
967f5a76b1 git_checkout_index: checkout other indexes
git_checkout_index can now check out other git_index's (that are not
necessarily the repository index).  This allows checkout_index to use
the repository's index for stat cache information instead of the index
data being checked out.  git_merge and friends now check out their
indexes directly instead of trying to blend it into the running index.
2014-07-01 17:32:15 -04:00
Edward Thomson
0cee70ebb7 Introduce cl_assert_equal_oid 2014-07-01 14:40:16 -04:00
Edward Thomson
eff531e103 Modify GIT_MERGE_CONFIG -> GIT_MERGE_PREFERENCE 2014-05-27 20:58:20 -05:00
Edward Thomson
a3622ba6cc Move GIT_MERGE_CONFIG_* to its own enum 2014-05-27 20:49:20 -05:00
Edward Thomson
d362093f9e Introduce GIT_MERGE_CONFIG_* for merge.ff settings
git_merge_analysis will now return GIT_MERGE_CONFIG_NO_FASTFORWARD
when merge.ff=false and GIT_MERGE_CONFIG_FASTFORWARD_ONLY when
merge.ff=true
2014-05-27 20:49:16 -05:00
Edward Thomson
a4e2c36a66 merge: checkout default shouldn't clobber given 2014-04-23 19:43:35 -04:00
Edward Thomson
26564d80aa merge: default checkout strategy for should be SAFE 2014-04-23 19:42:50 -04:00
Jacques Germishuys
6fefb7af84 Capture conflict information in MERGE_MSG for revert and merge 2014-04-14 16:16:22 +02:00
Edward Thomson
976634c467 Introduce git_merge_head_id 2014-03-31 11:43:38 -05:00
Edward Thomson
58c2b1c421 UNBORN implies FAST_FORWARD 2014-03-20 09:35:22 -07:00
Edward Thomson
ac584fcfd3 Introduce GIT_MERGE_ANALYSIS_UNBORN 2014-03-20 09:25:11 -07:00
Edward Thomson
97f3462ae6 git_merge_status -> git_merge_analysis 2014-03-20 09:25:10 -07:00
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
Ben Straub
6affd71f33 git_checkout_opts -> git_checkout_options 2014-03-06 09:44:51 -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
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
586be3b889 Add reflog parameters to git_reset 2014-02-03 15:05:55 -08:00
Carlos Martín Nieto
a1bbc0ce20 merge: rename _oid() -> id()
Following the rest of the series, use 'id' when refering to the value.
2014-01-25 08:15:44 +01:00
Carlos Martín Nieto
d541170c77 index: rename an entry's id to 'id'
This was not converted when we converted the rest, so do it now.
2014-01-25 08:15:44 +01:00
Edward Thomson
0ef19fe14c Merge submodules 2014-01-20 18:07:17 -05:00
Edward Thomson
db3462ce77 Support union merges 2014-01-20 17:15:15 -05:00
Edward Thomson
0e1ba46cfb Remove the "merge none" flag
The "merge none" (don't automerge) flag was only to aide in
merge trivial tests.  We can easily determine whether merge
trivial resulted in a trivial merge or an automerge by examining
the REUC after automerge has completed.
2014-01-20 17:15:14 -05:00