Commit Graph

127 Commits

Author SHA1 Message Date
crazymaster
d0b25d9dff Fix 2013-07-15 08:14:00 +09:00
crazymaster
2185dd6f99 Fix typo 2013-07-15 08:06:09 +09:00
crazymaster
19bee769d4 Revert "Replace Japanese characters with the encoded hexadecimal values"
This reverts commit a91e4d6b21.
2013-07-15 07:39:16 +09:00
crazymaster
a91e4d6b21 Replace Japanese characters with the encoded hexadecimal values 2013-07-15 07:30:18 +09:00
crazymaster
d6d34cd0f4 Add test for multi-byte characters 2013-07-14 21:07:40 +09:00
Russell Belfer
ca9b1702ab Fix memory leak in oid shortener tests 2013-05-29 09:18:21 -07:00
Vicent Martí
30caf0cf29 Merge pull request #1595 from arrbee/even-more-rename-fixes
Even more rename detection fixes
2013-05-24 01:13:48 -07:00
Axel Wagner
06c070b5bb Add testcase for #1600 2013-05-23 09:43:56 +02:00
Russell Belfer
a21cbb12db Significant rename detection rewrite
This flips rename detection around so instead of creating a
forward mapping from deltas to possible rename targets, instead
it creates a reverse mapping, looking at possible targets and
trying to find a source that they could have been renamed or
copied from.  This is important because each output can only
have a single source, but a given source could map to multiple
outputs (in the form of COPIED records).

Additionally, this makes a couple of tweaks to the public rename
detection APIs, mostly renaming a couple of options that control
the behavior to make more sense and to be more like core Git.

I walked through the tests looking at the exact results and
updated the expectations based on what I saw.  The new code is
different from the old because it cannot give some nonsense
results (like A was renamed to both B and C) which were part of
the outputs previously.
2013-05-22 10:37:12 -07:00
nulltoken
b81cc1d63b tag: Introduce git_tag_annotation_create() 2013-05-21 19:32:59 +02:00
Russell Belfer
660d59caa9 Add git_oid_nfmt - a flexible OID formatter
I frequently want to the the first N digits of an OID formatted
as a string and I'd like it to be efficient.  This function makes
that easy and I could rewrite the OID formatters in terms of it.
2013-05-17 16:40:00 -07:00
Russell Belfer
0f938c6b8f Fix win32 type warnings 2013-05-07 09:59:53 -07:00
Vicent Martí
03c28d92d0 Merge pull request #1526 from arrbee/cleanup-error-return-without-msg
Make sure error messages are set for most error returns
2013-05-06 06:45:53 -07:00
Russell Belfer
6e286e8dc5 Remove obsolete test for peel type
Peeling to an invalid type is now checked via an assert so this
test is no longer relevant.
2013-05-04 01:04:23 -07:00
Russell Belfer
d82d66c96d Extra threading tests
We need to hammer the packfile open phase harder in the thread
tests, in addition to the cache API.
2013-05-02 03:05:21 -07:00
Vicent Marti
d877159260 cache: Max cache size, and evict when the cache fills up 2013-04-22 17:04:52 +02:00
Vicent Marti
cf9709b64e tests: Do not warn for unused variable 2013-04-22 16:53:46 +02:00
Russell Belfer
38eef6113d Make indexer use shared packfile open code
The indexer was creating a packfile object separately from the
code in pack.c which was a problem since I put a call to
git_mutex_init into just pack.c.  This commit updates the pack
function for creating a new pack object (i.e. git_packfile_check())
so that it can be used in both places and then makes indexer.c
use the shared initialization routine.

There are also a few minor formatting and warning message fixes.
2013-04-22 16:52:07 +02:00
Russell Belfer
917f60c50b Add tests for oidmap and new cache with threading
This adds some basic tests for the oidmap just to make sure that
collisions, etc. are dealt with correctly.

This also adds some tests for the new caching that check if items
are inserted (or not inserted) properly into the cache, and that
the cache can hold up in a multithreaded environment without error.
2013-04-22 16:50:51 +02:00
Vicent Marti
8842c75f17 What has science done. 2013-04-22 16:50:50 +02:00
Russell Belfer
83cc70d9fe Move odb_backend implementors stuff into git2/sys
This moves some of the odb_backend stuff that is related to the
internals of an odb_backend implementation into include/git2/sys.

Some of the stuff related to streaming I left in include/git2
because it seemed like it would be reasonably needed by a normal
user who wanted to stream objects into and out of the ODB.

Also, I added APIs for traversing the list of backends so that
some of the tests would not need to access ODB internals.
2013-04-21 11:50:55 -07:00
nulltoken
24cb87e2a6 tag: Fix parsing when no tagger nor message 2013-03-31 14:36:51 +02:00
nulltoken
5a5bd64024 tests: Fix indentations 2013-03-31 14:17:38 +02:00
Russell Belfer
3658e81e34 Move crlf conversion into buf_text
This adds crlf/lf conversion functions into buf_text with more
efficient implementations that bypass the high level buffer
functions.  They attempt to minimize the number of reallocations
done and they directly write the buffer data as needed if they
know that there is enough memory allocated to memcpy data.

Tests are added for these new functions.  The crlf.c code is
updated to use the new functions.

Removed the include of buf_text.h from filter.h and just include
it more narrowly in the places that need it.
2013-03-25 14:20:07 -07:00
Edward Thomson
d00d54645d immutable references and a pluggable ref database 2013-03-07 11:01:52 -06:00
Michael Schubert
8005c6d420 Revert "hash: remove git_hash_init from internal api"
This reverts commit efe7fad6c9, except for
the indentation fixes.
2013-02-26 01:08:34 +01:00
Michael Schubert
efe7fad6c9 hash: remove git_hash_init from internal api
Along with that, fix indentation in tests-clar/object/raw/hash.c
2013-02-26 00:23:00 +01:00
Russell Belfer
0cfce06d08 Add more treebuilder tests
The recent changes with git_treebuilder_entrycount point out that
the test coverage for git_treebuilder_remove and
git_treebuilder_entrycount is completely absent.  This adds tests.
2013-02-20 11:58:21 -08:00
Scott J. Goldman
5c7b77c4f8 Seperate out a new test that verifies packed-refs with no trailing newline
as per @vmg's request
2013-01-22 16:01:03 -08:00
Scott J. Goldman
cb35094be3 Allow peeled references without trailing newline at end of file
Also ammends one of the tag tests to make sure it's working.
2013-01-22 15:49:51 -08:00
Edward Thomson
25743bd7c5 add an index_remove_bypath that removes conflicts, renamed add_from_workdir to match 2013-01-12 13:47:56 -06:00
Russell Belfer
8fe713ccf7 Make git_oid_tostr use out buffer for NULL oid
Previously a NULL oid was handled like an empty buffer and
returned a status empty string.  This makes git_oid_tostr()
set the output buffer to the empty string instead.
2013-01-04 15:47:42 -08:00
Vicent Marti
2d466b7dcb tests: Fix unused temp repo 2012-12-14 02:49:11 +01:00
Ben Straub
72629a10e3 Clean up GCC build warnings 2012-12-10 10:05:31 -08:00
Carlos Martín Nieto
f1c75b94a1 tree: relax the filemode parser
There are many different broken filemodes in the wild so we need to
protect against them and give something useful up the chain. Don't
fail when reading a tree from the ODB but normalize the mode as best
we can.

As 664 is no longer a mode that we consider to be valid and gets
normalized to 644, we can stop accepting it in the treebuilder. The
library won't expose it to the user, so any invalid modes are a bug.
2012-12-07 16:59:18 +01:00
nulltoken
bc05f30c47 object: refine git_object_peel() error report 2012-12-01 08:34:29 +01:00
nulltoken
18d6f12040 tag: Deploy EINVALIDSPEC usage 2012-12-01 08:34:28 +01:00
Vicent Martí
f1e5c506b2 Merge pull request #1110 from libgit2/features/push_rebased
Push! By schu, phkelley, and congyiwu
2012-11-29 12:18:05 -08:00
Philip Kelley
ac22d08f2f Remove git_object_oid2type 2012-11-29 08:22:15 -05:00
Russell Belfer
7bf87ab698 Consolidate text buffer functions
There are many scattered functions that look into the contents of
buffers to do various text manipulations (such as escaping or
unescaping data, calculating text stats, guessing if content is
binary, etc).  This groups all those functions together into a
new file and converts the code to use that.

This has two enhancements to existing functionality.  The old
text stats function is significantly rewritten and the BOM
detection code was extended (although largely we can't deal with
anything other than a UTF8 BOM).
2012-11-28 09:58:48 -08:00
Philip Kelley
613d5eb939 Push! By schu, phkelley, and congyiwu, et al 2012-11-28 11:42:37 -05:00
Russell Belfer
a8122b5d4a Fix warnings on Win64 build 2012-11-27 13:18:29 -08:00
Ben Straub
f45d51ff8e API updates for index.h 2012-11-27 13:18:28 -08:00
Russell Belfer
d9023dbe0c API updates for tag.h 2012-11-27 13:18:28 -08:00
Russell Belfer
e120123e36 API review / update for tree.h 2012-11-27 13:18:28 -08:00
Vicent Marti
cfbe4be3fb More external API cleanup
Conflicts:
	src/branch.c
	tests-clar/refs/branches/create.c
2012-11-27 13:18:27 -08:00
Ben Straub
2508cc66eb Rename ref and reflog apis for consistency 2012-11-27 13:17:45 -08:00
Sascha Cunz
9094d30b93 Reset all static variables to NULL in clar's __cleanup
Without this change, any failed assertion in the second (or a later) test
inside a test suite has a chance of double deleting memory, resulting in
a heap corruption. See #1096 for details.

This leaves alone the test cases where we "just" use cl_git_sandbox_init()
and cl_git_sandbox_cleanup(). These methods already take good care to not
double delete a repository.

Fixes #1096
2012-11-23 11:41:56 +01:00
Scott J. Goldman
19af78bb36 Prevent creating .., ., and .git with tree builder
As per core git.
2012-11-18 15:15:24 -08:00
nulltoken
aa8a76eff9 tag: rename git_tag_type to git_tag_target_type 2012-11-17 05:41:20 -08:00