Commit Graph

1285 Commits

Author SHA1 Message Date
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
7ee8c7e677 refs: placeholder conditional delete
We don't actually pass the old value yet.
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
911236619b refdb: add conditional symbolic updates
Add a parameter to the backend to allow checking for the old symbolic
target.
2014-02-05 12:07:56 +01:00
Carlos Martín Nieto
fc4728e3e2 refs: return GIT_EMODIFIED if the ref target moved
In case we loose the race to update the reference, return GIT_EMODIFIED
to let the user distinguish it from other types of errors.
2014-02-05 12:07:56 +01:00
Carlos Martín Nieto
5d96fe8828 refs: changes from feedback
Change the name to _matching() intead of _if(), and force _set_target()
to be a conditional update. If the user doesn't care about the old
value, they should use git_reference_create().
2014-02-05 12:07:56 +01:00
Carlos Martín Nieto
9b148098e6 refs: conditional ref updates
Allow updating references if the old value matches the given one.
2014-02-05 12:07:56 +01:00
Arthur Schreiber
50ad7cc208 Add git_reference_is_note. 2014-02-02 18:20:38 +01:00
Ben Straub
a1b07dca7d Document branch-creation reflog better 2014-01-30 15:53:52 -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
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
94f263f59b Add reflog params to set-head calls 2014-01-30 15:51:00 -08:00
Russell Belfer
e9d5e5f3d4 Some fixes for Windows x64 warnings 2014-01-30 09:59:59 -08:00
Russell Belfer
c0644c3fbb Make submodule fetchRecurse match other options
This removes the fetchRecurse compiler warnings and makes the
behavior match the other submodule options (i.e. the in-memory
setting can be reset to the on-disk value).
2014-01-30 09:59:59 -08:00
Russell Belfer
5572d2b8a1 Some missing oid to id renames 2014-01-30 09:59:59 -08:00
Arthur Schreiber
e7c16943f4 Add git_graph_descendant_of. 2014-01-28 19:39:14 +01:00
Vicent Marti
93954245e0 Merge pull request #2075 from libgit2/cmn/leftover-oid
Leftover OID -> ID changes
2014-01-27 09:39:36 -08:00
Carlos Martín Nieto
bf522e0811 refspec: move to git_buf for outputting strings 2014-01-27 04:44:06 +01:00
Carlos Martín Nieto
e1d7f0035e messsage: use git_buf in prettify()
A lot of the tests were checking for overflow, which we don't have
anymore, so we can remove them.
2014-01-27 04:44:06 +01:00
Carlos Martín Nieto
ee550477d1 config: use git_buf for returning paths
Again, we already did this internally, so simply remove the conversions.
2014-01-27 04:44:05 +01: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
Carlos Martín Nieto
7a3bd1e732 repository: move to use a git_buf for outputting strings
Since we now export that type, we can avoid making the user guess a
size.
2014-01-27 04:44:05 +01:00
Arthur Schreiber
991b2840eb Make sure git_remote_dup copies a remote's refspecs correctly. 2014-01-26 19:35:02 +01:00
Arthur Schreiber
11f6ad5fcf Add some missing const declarations. 2014-01-26 18:08:05 +01: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
86bfc3e1c6 diff: change id abbrev option's name to id_abbrev
Same as the other commits in the series, we use 'id' when talking about
thing rather than the datatype.
2014-01-25 08:15:44 +01:00
Carlos Martín Nieto
9950bb4e8d diff: rename the file's 'oid' to 'id'
In the same vein as the previous commits in this series.
2014-01-25 08:15:44 +01:00
Carlos Martín Nieto
f000ee4e5b tree: remove legacy 'oid' naming
Rename git_tree_entry_byoid() to _byid() as per the convention.
2014-01-25 08:15:44 +01:00
Carlos Martín Nieto
47e28349bc commit: remvoe legacy 'oid' naming 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
Carlos Martín Nieto
d0a3de720e note: rename the id getter to git_note_id()
This was left over when we did the general switch.
2014-01-24 11:18:51 +01:00
Nicolas Hake
c05cd7924d Drop git_patch_to_str
It's hard or even impossible to correctly free the string buffer
allocated by git_patch_to_str in some circumstances. Drop the function
so people have to use git_patch_to_buf instead - git_buf has a dedicated
destructor.
2014-01-22 17:51:32 +01:00
Nicolas Hake
450e8e9e62 Expose patch serialization to git_buf
Returning library-allocated strings from libgit2 works fine on Linux,
but may cause problems on Windows because there is no one C Runtime that
everything links against. With libgit2 not exposing its own allocator,
freeing the string is a gamble.

git_patch_to_str already serializes to a buffer, then returns the
underlying memory. Expose the functionality directly, so callers can use
the git_buf_free function to free the memory later.
2014-01-22 13:40:19 +01: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
Edward Thomson
e651e8e2b5 Introduce diff3 mode for checking out conflicts 2014-01-20 17:15:13 -05:00
Edward Thomson
c1d648c5c6 merge_file should use more aggressive levels
The default merge_file level was XDL_MERGE_MINIMAL, which will
produce conflicts where there should not be in the case where
both sides were changed identically.  Change the defaults to be
more aggressive (XDL_MERGE_ZEALOUS) which will more aggressively
compress non-conflicts.  This matches git.git's defaults.

Increase testing around reverting a previously reverted commit to
illustrate this problem.
2014-01-20 17:15:11 -05:00
Edward Thomson
b554ca5dc1 "Uninitialized" submodules are "unmodified"
Extend the "unmodified" submodule workdir test to include
uninitialized submodules, to prevent reporting submodules as
modified when they're not in the workdir at all.
2014-01-20 17:09:31 -05:00
Arthur Schreiber
3f033c5595 Revert a wrong doc change. 2014-01-16 21:53:25 +01:00
Arthur Schreiber
3f0e3e1662 Fix some documentation issues. 2014-01-16 21:42:28 +01:00
Carlos Martín Nieto
0b28217bda refs: remove the _with_log differentiation
Any well-behaved program should write a descriptive message to the
reflog whenever it updates a reference. Let's make this more prominent
by removing the version without the reflog parameters.
2014-01-15 13:32:43 +01:00
Arthur Schreiber
529f342aba Align git_tree_entry_dup. 2014-01-14 21:33:59 +01:00
Arthur Schreiber
29be3a6d9e Align git_signature_dup.
This changes git_signature_dup to actually honor oom conditions raised by
the call to git__strdup. It also aligns it with the error code return
pattern used everywhere else.
2014-01-14 21:33:35 +01:00
Arthur Schreiber
40ef47dd46 Add git_remote_dup. 2014-01-14 21:03:01 +01:00
Edward Thomson
6adcaab70c Handle git_buf's from users more liberally 2014-01-08 10:08:23 -08:00
John Crepezzi
e7f89b46c3 Fix spelling mistake
Closes #2029
2014-01-04 18:18:59 -05:00
Russell Belfer
ac9f92316b Merge pull request #2022 from KTXSoftware/development
submodule branch option + little VS2013 fix
2014-01-03 14:40:25 -08:00
Russell Belfer
9152417290 Fix warnings with submodule changes 2014-01-02 14:30:24 -08:00