Commit Graph

6178 Commits

Author SHA1 Message Date
Sascha Cunz
39949f0604 Cleanup FindIconv.cmake
Doesn't change anything. Just removes stuff that was probably missed
to remove when this was imported.
2014-01-30 02:35:09 +00:00
Sascha Cunz
60306450b7 Use relative path to set cmake module path
This has actually no effect on a "normal" build, but allows to use
libgit2 as a part of a larger project via CMake's ADD_SUBDIRECTORY()

Closes #2087
2014-01-30 02:33:51 +00:00
Edward Thomson
0972c59205 Two-phase index merging
When three-way merging indexes, we previously changed each path
as we read them, which would lead to us adding an index entry for
'foo', then removing an index entry for 'foo/file'.  With the new
index requirements, this is not allowed.  Removing entries in the
merged index, then adding them, resolves this.  In the previous
example, we now remove 'foo/file' before adding 'foo'.
2014-01-29 13:15:55 -08:00
Edward Thomson
b747eb1445 Give index_isrch the same semantics as index_srch
In case insensitive index mode, we would stop at a prefixed entry,
treating the provided search key length as a substring, not the
length of the string to match.
2014-01-29 13:15:54 -08:00
Edward Thomson
bae8bea051 More index collision tests 2014-01-29 13:15:53 -08:00
Vicent Marti
1eefd35612 index: Implement folder-file checks 2014-01-29 13:15:52 -08:00
Vicent Marti
53bec813a8 index: Compare with given len 2014-01-29 13:15:51 -08:00
Russell Belfer
95fbedcd8e Add test for blob/tree name collisions in index 2014-01-29 13:15:50 -08:00
Vicent Marti
66af84494c Merge pull request #2086 from ethomson/fixup
Don't strcmp a git_buf, strcmp its char *
2014-01-29 12:57:42 -08:00
Edward Thomson
96f12e709b Don't strcmp a git_buf, strcmp its char * 2014-01-29 12:50:42 -08:00
Vicent Marti
cd4aa602c9 Merge pull request #2083 from arthurschreiber/arthur/add-git_commit_descendant_of
Add `git_commit_descendant_of`.
2014-01-28 10:50:04 -08:00
Arthur Schreiber
e7c16943f4 Add git_graph_descendant_of. 2014-01-28 19:39:14 +01:00
Vicent Marti
a1a9d0bd48 Merge pull request #2066 from libgit2/rb/builtin-diff-drivers
Add built in diff drivers
2014-01-27 15:35:39 -08:00
Russell Belfer
daebb59869 Add PHP tests and fix bug in PHP builtin driver 2014-01-27 14:57:03 -08:00
Russell Belfer
082e82dba5 Update Javascript userdiff driver and tests
Writing a sample Javascript driver pointed out some extra
whitespace handling that needed to be done in the diff driver.
This adds some tests with some sample javascript code that I
pulled off of GitHub just to see what would happen.  Also, to
clean up the userdiff test data, I did a "git gc" and packed
up the test objects.
2014-01-27 11:45:06 -08:00
Russell Belfer
4115987739 Got permission from Gustaf for userdiff patterns 2014-01-27 10:23:55 -08: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
Vicent Marti
46e7fc1853 Merge pull request #2077 from libgit2/cmn/buf-out
Buff up returning strings
2014-01-27 09:36:24 -08:00
Vicent Marti
c90ea3de78 Merge pull request #2078 from linquize/msvc
MSVC doesn't like modern code neither
2014-01-27 09:34:52 -08:00
Vicent Marti
9ff34a533d Merge pull request #2079 from linquize/msvc-blame-example
Make blame example compile on MSVC
2014-01-27 09:34:32 -08:00
Linquize
1664aaaa26 Make blame example compile on MSVC 2014-01-27 22:41:05 +08:00
Linquize
fbc5661ebf MSVC doesn't like modern code neither 2014-01-27 20:52:57 +08:00
Carlos Martín Nieto
66d585c6b3 MSVC doesn't like modern code 2014-01-27 04:58:23 +01: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
Ben Straub
1087d4fd01 Merge pull request #2052 from arthurschreiber/arthur/add-git_remote_dup
Fix git_remote_dup & add missing const
2014-01-26 11:27:44 -08: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
Edward Thomson
93b96ea705 Merge pull request #2076 from xtao/fix-zstream
Fix write_object.
2014-01-26 06:38:02 -08:00
Edward Thomson
58582cd0b0 Merge pull request #2057 from GrahamDennis/local-file-url-push-fix
Fix local push to file:// URL.
2014-01-26 06:31:38 -08:00
XTao
1cb5a81194 Fix write_object. 2014-01-26 22:26:53 +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
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
Russell Belfer
7cc001cefb Add PHP and Javascript diff drivers
Since I don't have permission yet on the code from Git, I decided
I'd take a stab at writing patterns for PHP and Javascript myself.
I think these are pretty weak, but probably better than the
default behavior without them.
2014-01-24 15:46:15 -08:00
Russell Belfer
027b8edac7 Move userdiff tests to be data driven
This moves the expected and actual test data along with the source
data for the userdiff tests into the tests/resources/userdiff test
repo and updates the test to use that.
2014-01-24 15:45:49 -08:00
Russell Belfer
3b19d2fdcb Permission for Git code from a couple more
This brings over the Pascal and CSharp userdiff data.
2014-01-24 10:54:05 -08:00
Russell Belfer
c7c260a5ff Got some permission to use userdiff patterns
I contacted a number of Git authors and lined up their permission
to relicense their work for use in libgit2 and copied over their
code for diff driver xfuncname patterns.  At this point, the code
I've copied is taken verbatim from core Git although Thomas Rast
warned me that the C++ patterns, at least, really need an update.
I've left off patterns where I don't feel like I have permission
at this point until I hear from more authors.
2014-01-24 10:54:05 -08:00
Russell Belfer
5d82c0df13 Update all tests for new pattern extraction 2014-01-24 10:54:05 -08:00
Russell Belfer
b8e86c62f7 Implement matched pattern extract for fn headers 2014-01-24 10:54:05 -08:00
Russell Belfer
9bbc53d6d4 Fix filemode updating in diff text 2014-01-24 10:54:05 -08:00
Russell Belfer
2c65602e45 Import git drivers and test HTML driver
Reorganize the builtin driver table slightly so that core Git
builtin definitions can be imported verbatim.  Then take a few of
the core Git drivers and pull them in.

This also creates a test of diffs with the builtin HTML driver
which led to some small error handling fixes in the driver
selection logic.
2014-01-24 10:51:08 -08:00
Russell Belfer
a5a386436b Initial take on builtin drivers with multiline
This extends the diff driver parser to support multiline driver
definitions along with ! prefixing for negated matches.  This
brings the driver function pattern parsing in line with core Git.

This also adds an internal table of driver definitions and a
fallback code path that will look in that table for diff drivers
that are set with attributes without having a definition in the
config file.  Right now, I just populated the table with a kind
of simple HTML definition that is similar to the core Git def.
2014-01-24 10:43:05 -08: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