Commit Graph

942 Commits

Author SHA1 Message Date
Philip Kelley
cfc39f5078 Fix 3 memory leaks 2013-01-25 22:43:52 -05:00
Carlos Martín Nieto
9f35754a0e config: support trailing backslashes
Check whether the backslash at the end of the line is being escaped or
not so as not to consider it a continuation marker when it's e.g. a
Windows-style path.
2013-01-25 13:29:28 +01:00
Michael Schubert
26ec6a6db3 tests-clar: ifdef GIT_WIN32 win helper functions 2013-01-25 13:07:26 +01:00
Sebastian Bauer
c253056d24 Added git_branch_name().
This is a convenience function to get the branch name of a given
ref. The returned branch name is compatible with the name that can
be supplied e.g. to git_branch_lookup(). That is, the prefixes
"refs/heads" or "refs/remotes" are omitted.

Also added a new test for testing the new function.
2013-01-25 05:24:21 +01:00
Philip Kelley
2ff4469afc Leak cleanup in push tests 2013-01-24 14:04:35 -05:00
Philip Kelley
3fbd7485d8 Merge pull request #1250 from jamill/push_update_tips
Update remote tips on push
2013-01-24 11:03:11 -08:00
Vicent Marti
0d52cb4aea opts: Some basic tests 2013-01-24 00:09:55 +01:00
Russell Belfer
8958fad770 Merge pull request #1270 from libgit2/packed-peeled-objects-fix
Allow peeled references without trailing newline at end of file
2013-01-22 16:02:43 -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
Russell Belfer
cce548e3e0 Fix case sensitivity bug with tree iterators
With the new code to make tree iterators support ignore_case,
there is a bug in setting the start entry for range bounded
iterators where memcmp was being used instead of strncasecmp.
This fixes that and expands the tree iterator test to cover
the cases that were broken.
2013-01-22 15:28:25 -08:00
Jameson Miller
1d645aabef Update remote tips on push 2013-01-22 10:01:43 -05:00
Russell Belfer
e8a92fe107 Update clar to a80e7f30 2013-01-21 13:39:53 -08:00
Russell Belfer
965e4e2d31 Parse commit time as uint64_t to avoid overflow
The commit time is already stored as a git_time_t, but we were
parsing is as a uint32_t.  This just switches the parser to use
uint64_t which will handle dates further in the future (and adds
some tests of those future dates).
2013-01-21 13:19:41 -08:00
Zhao Cheng
c55c624441 Fix linking error caused by ddcb28a41f. 2013-01-18 13:22:55 +08:00
Vicent Martí
ddcb28a41f Merge pull request #1239 from ethomson/index_remove
add an index_remove_bypath that removes conflicts
2013-01-17 16:56:57 -08:00
Vicent Martí
3a93ab9065 Merge pull request #1256 from arrbee/asciify-test-data
Move all non-ascii test data to raw hex
2013-01-17 16:33:40 -08:00
Edward Thomson
271680d7f4 add a git config, don't run crlf tests on non-win32 2013-01-17 18:18:44 -06:00
Russell Belfer
f63d0ee9fc Move all non-ascii test data to raw hex
This takes all of the characters in core::env and makes them use
hex sequences instead of keeping tricky character data inline in
the test.
2013-01-17 15:47:10 -08:00
Ben Straub
c49fa037cc Merge pull request #1247 from sba1/dont-segfault-if-transport-doesnt-support-push
Don't segfault if transport doesn't support push.
2013-01-17 13:37:32 -08:00
Vicent Martí
5c8901ab80 Merge pull request #1255 from arrbee/fix-signed-commit-header-parsing
Add skipping of unknown commit headers
2013-01-17 13:36:33 -08:00
Sebastian Bauer
b90eb84ff9 Test that pushs properly fail for transports that don't provide a push implementation. 2013-01-17 22:32:37 +01:00
Russell Belfer
291090a076 Add skipping of unknown commit headers
This moves the check for the "encoding" header into a loop which
is just scanning for non-required headers at the end of a commit
header.  That loop will skip unrecognized lines (including header
continuation lines) until a terminating completely blank line is
found, and only then does it move to reading the commit message.
2013-01-17 13:19:09 -08:00
Edward Thomson
6e959708e5 cache should contain on-disk (filtered) file size 2013-01-17 15:17:32 -06:00
Vicent Martí
34a4ad46e8 Merge pull request #1211 from arrbee/fix-icase-status-file
Fix case insensitivity issues in git_status_file
2013-01-16 15:52:58 -08:00
nulltoken
bf031581d3 branch: Introduce git_branch_tracking_name() 2013-01-16 22:56:13 +01:00
Russell Belfer
25423d03b8 Support case insensitive tree iterators and status
This makes tree iterators directly support case insensitivity by
using a secondary index that can be sorted by icase.  Also, this
fixes the ambiguity check in the git_status_file API to also be
case insensitive.  Lastly, this adds new test cases for case
insensitive range boundary checking for all types of iterators.

With this change, it should be possible to deprecate the spool
and sort iterator, but I haven't done that yet.
2013-01-15 09:51:35 -08:00
Russell Belfer
a49340c3e5 Test for ignore_case ranges on workdir iterator
This adds a test that confirms that the working directory iterator
can actually correctly process ranges of files case insensitively
with proper sorting and proper boundaries.
2013-01-15 09:51:34 -08:00
Russell Belfer
134d8c918c Update iterator API with flags for ignore_case
This changes the iterator API so that flags can be passed in to
the constructor functions to control the ignore_case behavior.
At this point, the flags are not supported on tree iterators (i.e.
there is no functional change over the old API), but the API
changes are all made to accomodate this.

By the way, I went with a flags parameter because in the future
I have a couple of other ideas for iterator flags that will make
it easier to fix some diff/status/checkout bugs.
2013-01-15 09:51:34 -08:00
Russell Belfer
4b18103755 Minor iterator API cleanups
In preparation for further iterator changes, this cleans up a few
small things in the iterator API:

* removed the git_iterator_for_repo_index_range API
* made git_iterator_free not be inlined
* minor param name and test function name tweaks
2013-01-15 09:49:32 -08:00
nulltoken
bcbb1e201b status: Enhance git_status_file() test coverage 2013-01-15 09:49:32 -08:00
Russell Belfer
230010d19b Merge pull request #1238 from nulltoken/fix/checkout-index
checkout: Teach checkout to cope with orphaned Head
2013-01-15 09:46:50 -08:00
Russell Belfer
848d77dc83 Merge pull request #1242 from sba1/init-with-template-fix
Some fixes for external template support
2013-01-14 10:05:35 -08:00
Sebastian Bauer
72719e7333 Altered the description of the template.
Before, it was identical to the default template making it difficult
to check, if the proper template was copied an external template
test.
2013-01-13 12:26:52 +01:00
Sebastian Bauer
5885ba112d Now checks in the template test whether the description file has
been properly copied.

This is a minimal effort to test whether the template really has
been used when creating an repo with external templates.
2013-01-13 12:26:52 +01:00
nulltoken
5b524d6902 Fix Travis compilation warnings 2013-01-13 10:25:55 +01:00
nulltoken
2a3b3e0324 checkout: Teach checkout to cope with orphaned Head
Fix #1236
2013-01-13 10:25:54 +01: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
Carlos Martín Nieto
0b3aa7bede tests: plug leaks 2013-01-12 19:01:45 +01:00
Sebastian Bauer
4a4aee1112 Added flag GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE to test_repo_init__extended_with_template().
Otherwise the template functionallity is not tested (as a TODO we
also shall test that the specified template really got copied).
2013-01-12 18:44:50 +01:00
Vicent Martí
e2d2c6e57d Merge pull request #1222 from scunz/clone_branch
Switch to specified branch during clone
2013-01-12 02:14:14 -08:00
Philip Kelley
359316b5d3 Merge pull request #1215 from phkelley/binaryunicode
Add a failing test for CRLF filters
2013-01-11 17:16:55 -08:00
Philip Kelley
dd6367e37e Fix up binaryunicode test repo 2013-01-11 20:07:52 -05:00
Sascha Cunz
f1d4a35e94 Tests: Add test for check out of given branch during clone 2013-01-12 00:08:48 +01:00
Sascha Cunz
b5b2812097 Test: Cleanup some cleaning code 2013-01-12 00:07:44 +01:00
Vicent Martí
160e4fb792 Merge pull request #1230 from arrbee/match-core-git-diff-binary-detection
Match binary file check of core git in diff
2013-01-11 11:35:09 -08:00
Vicent Martí
6e19edaa40 Merge pull request #1229 from arrbee/fix-diff-patch-line-numbers
Fix diff patch line number calculation
2013-01-11 11:34:13 -08:00
Russell Belfer
0d65acade8 Match binary file check of core git in diff
Core git just looks for NUL bytes in files when deciding about
is-binary inside diff (although it uses a better algorithm in
checkout, when deciding if CRLF conversion should be done).
Libgit2 was using the better algorithm in both places, but that
is causing some confusion.  For now, this makes diff just look
for NUL bytes to decide if a file is binary by content in diff.
2013-01-11 11:24:26 -08:00
Russell Belfer
805c476c83 Fix diff patch line number calculation
This was just wrong.  Added a test that verifying patch line
numbers even for hunks further into a file and then fixed the
algorithm.  I needed to add a little extra state into the patch
so that I could track old and new file numbers independently,
but it should be okay.
2013-01-11 11:20:44 -08:00
nulltoken
f3738eba56 Fix MSVC Clar compilation warnings 2013-01-11 19:31:00 +01:00