Commit Graph

1139 Commits

Author SHA1 Message Date
Russell Belfer
c2c0874de2 More diff tests with binary data 2013-02-11 14:45:46 -08:00
nulltoken
2bca5b679b remote: Introduce git_remote_is_valid_name()
Fix libgit2/libgit2sharp#318
2013-02-11 23:19:41 +01:00
nulltoken
4d811c3b77 refs: No component of a refname can end with '.lock' 2013-02-11 23:19:40 +01:00
nulltoken
624924e876 remote: reorganize tests 2013-02-11 23:19:39 +01:00
Russell Belfer
390a3c8141 Merge pull request #1190 from nulltoken/topic/reset-paths
reset: Allow the selective reset of pathspecs
2013-02-11 11:44:00 -08:00
Philip Kelley
e026cfee00 Merge pull request #1323 from jamill/resolve_remote
Resolve a remote branch's remote
2013-02-11 09:12:39 -08:00
Jameson Miller
db4bb4158f Teach refspec to transform destination reference to source reference 2013-02-11 11:36:28 -05:00
Jameson Miller
2e3e8c889b Teach remote branch to return its remote 2013-02-11 11:36:22 -05:00
Philip Kelley
b8b897bbc5 Add git_push_options, to set packbuilder parallelism 2013-02-11 09:35:26 -05:00
Philip Kelley
8c29dca6c3 Fix some incorrect MSVC #ifdef's. Fixes #1305 2013-02-11 09:25:57 -05:00
Scott J. Goldman
6ce61a0bf6 tests: fix whitespace in refs/rename.c 2013-02-08 14:25:41 -08:00
yorah
0d64ba4837 diff: add a notify callback to git_diff__from_iterators
The callback will be called for each file, just before the `git_delta_t` gets inserted into the diff list.

When the callback:
- returns < 0, the diff process will be aborted
- returns > 0, the delta will not be inserted into the diff list, but the diff process continues
- returns 0, the delta is inserted into the diff list, and the diff process continues
2013-02-07 20:44:35 +01:00
Scott J. Goldman
c9459abb61 tests: fix indentation in repo/message.c 2013-02-07 03:12:39 -08:00
Scott J. Goldman
f7b060188a tests: fix indentation in repo/init.c 2013-02-07 03:04:50 -08:00
Scott J. Goldman
1ca163ff13 tests: fix code style in threads/basic.c 2013-02-07 02:04:17 -08:00
Ben Straub
beede4321f Fetchhead: don't expect a tag that isn't there 2013-02-06 13:25:43 -08:00
Ben Straub
169fa384fe Fix fetchhead tests to expect nearly-dangling 2013-02-06 13:16:13 -08:00
nulltoken
e8993455d1 diff: Enhance tree-to-tree diff test coverage
These tests are related to issue libgit2/libgit2sharp#196
2013-02-06 19:45:44 +01:00
nulltoken
7e8580452c diff: refactor git_diff_tree_to_tree() tests 2013-02-06 16:13:23 +01:00
nulltoken
f093cd62c4 Add unsymlinked.git test repository 2013-02-06 16:03:06 +01:00
Ben Straub
def60ea473 Allow all non-zero returns to cancel transfers 2013-02-05 13:14:48 -08:00
Ben Straub
42385c96d5 Enhance test coverage for transfer cancellation 2013-02-05 12:10:08 -08:00
nulltoken
3ad052218c Fix MSVC compilation warnings
Fix #1308
2013-02-05 20:33:27 +01:00
nulltoken
d96aa8a9ca tests: Remove useless code 2013-02-05 20:33:16 +01:00
nulltoken
a0c34c9406 reset: Introduce git_reset_default() 2013-02-05 20:33:03 +01:00
Ben Straub
fe95ac1b67 Allow progress callback to cancel fetch
This works by having the indexer watch the return
code of the callback, so will only take effect
on object boundaries.
2013-02-05 10:59:58 -08:00
Russell Belfer
de81aee390 Merge pull request #1298 from ben/user-at
Handle "user@" prefix for credentials partially included in URLs
2013-02-04 14:49:28 -08:00
nulltoken
0e8e5a6189 revparse: Lookup sha before branch 2013-02-03 11:44:26 +01:00
nulltoken
545b479a07 revparse: Lookup branch before described tag
Fix #1306
2013-02-03 11:18:24 +01:00
Ben Straub
329eee3387 Merge pull request #1286 from lznuaa/master
Fix clone fail if repo head detached
2013-02-01 09:41:50 -08:00
Frank Li
aa928de02a Add test case for clone head detached repo
Signed-off-by: Frank Li <lznuaa@gmail.com>
Signed-off-by: nulltoken <emeric.fermas@gmail.com>
2013-02-01 22:40:23 +08:00
Ben Straub
54ffc1f773 HTTP: use creds in url if available 2013-01-31 14:41:01 -08:00
Ben Straub
cd74cbba18 Plug test leaks 2013-01-31 14:38:22 -08:00
Ben Straub
cf7038a65c Enhance url parsing to include passwords 2013-01-31 14:04:21 -08:00
Carlos Martín Nieto
e5ef0f1814 refs: handle ALLOW_ONELEVEL normalization with leading slash
A leading slash confuses the name normalization code when the flags
include ALLOW_ONELEVEL. Catch this case in particular to avoid
triggering an assertion in the uppercase check which expects us not to
pass it an empty string.

The existing tests don't catch this as they simply use the NORMAL
flag.

This fixes #1300.
2013-01-31 20:23:30 +01:00
Ben Straub
7602cb7c0e Add user-from-url param to auth callback 2013-01-31 10:44:57 -08:00
Ben Straub
5f10853e90 Skip "user@" when finding hostname in url 2013-01-30 18:52:47 -08:00
Russell Belfer
3bf68be443 Free buffer at end of test 2013-01-30 11:25:20 -08:00
Russell Belfer
f1e2735c74 Add helper for diff line stats
This adds a `git_diff_patch_line_stats()` API that gets the total
number of adds, deletes, and context lines in a patch.  This will
make it a little easier to emulate `git diff --stat` and the like.

Right now, this relies on generating the `git_diff_patch` object,
which is a pretty heavyweight way to get stat information.  At
some future point, it would probably be nice to be able to get
this information without allocating the entire `git_diff_patch`,
but that's a much larger project.
2013-01-30 11:10:39 -08:00
Vicent Martí
d204121657 Merge pull request #1296 from arrbee/stricter-config-name-checks
Stricter config entry name validation
2013-01-29 13:57:53 -08:00
Russell Belfer
4657fc1cab Merge pull request #1285 from phkelley/vector
Vector improvements and their fallout
2013-01-29 13:54:08 -08:00
Russell Belfer
501d35ccf8 Test config name validation
This is @nulltoken's work to test various invalid config section
and key names and make sure we are validating properly.
2013-01-29 12:16:59 -08:00
Russell Belfer
17c92beaca Test buf join with NULL behavior explicitly 2013-01-29 12:13:24 -08:00
Congyi Wu
96447d24f3 Fix 2 bugs in online::push tests.
- Fix stack corruption introduced in 9bccf33c due to passing pointer to
local variable _cred_acquire_called.
- Fix strcmp in do_verify_push_status when expected or actual push_status
  is NULL
2013-01-28 16:56:56 -05:00
Philip Kelley
11d9f6b304 Vector improvements and their fallout 2013-01-27 14:17:07 -05:00
Vicent Martí
4adb4815bf Merge pull request #1278 from sba1/cl-assert-equal-s
Use cl_assert_equal_s() instead of strcmp().
2013-01-25 20:37:39 -08:00
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
a7f8065f8c Use cl_assert_equal_s() instead of strcmp().
Replaced all cl_assert(!strcmp()) or semantically equivalent forms
by cl_assert_equal_s().
2013-01-25 06:55:56 +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
nulltoken
090d5e1fda Fix MSVC compilation warnings 2013-01-11 19:30:59 +01:00
nulltoken
4a0ac175ca checkout: Deploy EMERGECONFLICT usage 2013-01-11 19:30:58 +01:00
nulltoken
cce2f16b9d Fix indentations 2013-01-11 19:30:56 +01:00
Carlos Martín Nieto
2086e1baef tests: plug a couple of leaks 2013-01-11 16:54:57 +01:00
Russell Belfer
40342bd2b6 Add GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH
This adds an option to checkout a la the diff option to turn off
fnmatch evaluation for pathspec entries.  This can be useful to
make sure your "pattern" in really interpretted as an exact file
match only.
2013-01-10 15:15:37 -08:00
Vicent Martí
404880b1ba Merge pull request #1206 from ben/stock-auth
Expose stock user/pass credential utility
2013-01-10 11:24:09 -08:00
Edward Thomson
eb3c247a78 REUC needs to handle empty sides 2013-01-10 11:56:02 -06:00
Ben Straub
520dcc1c00 Move credential helpers to their own (optional) header 2013-01-09 13:31:17 -08:00
Ben Straub
ffb02b1630 Expose stock user/pass credential utility 2013-01-09 13:31:17 -08:00
Philip Kelley
fcc48d1fce Add a failing test for autocrlf filters 2013-01-09 12:37:22 -05:00
Michael Schubert
abeefbbe18 push: properly handle tags
Currently, push doesn't really handle tags when queueing objects. Fix
it.
2013-01-09 17:05:21 +01:00
Michael Schubert
f85b62840a tests-clar/network: remove unused CREATE_BLOB 2013-01-09 16:44:12 +01:00
Jameson Miller
087f64d3e3 Relax refspecs accepted by push 2013-01-09 16:15:58 +01:00
Russell Belfer
de59055017 Resolve crash with diff against empty file
It is not legal inside our `p_mmap` function to mmap a zero length
file.  This adds a test that exercises that case inside diff and
fixes the code path where we would try to do that.

The fix turns out not to be a lot of code since our default file
content is already initialized to "" which works in this case.

Fixes #1210
2013-01-08 17:11:11 -08:00
Russell Belfer
f2b7f7a6cb Share git_diff_blobs/git_diff_blob_to_buffer code
This moves the implementation of these two APIs into common code
that will be shared between the two.  Also, this adds tests for
the `git_diff_blob_to_buffer` API.  Lastly, this adds some extra
`const` to a few places that can use it.
2013-01-07 15:44:22 -08:00
Edward Thomson
c31ae146b4 merge cleanup should actually cleanup and the test should actually test 2013-01-06 18:38:29 -06:00
Vicent Martí
74f880a639 Merge pull request #1197 from nulltoken/travis/run-online-tests
travis: Include the online suite when running against Travis
2013-01-06 07:56:08 -08:00
nulltoken
b97fabfad5 tests: Fix some memory leaks 2013-01-06 16:22:24 +01:00
Vicent Martí
d74b1bc529 Merge pull request #1131 from libgit2/correct-ahead-behind
Fix an issue with ahead-behind for lopsided traversal
2013-01-05 15:44:19 -08:00
Russell Belfer
2f0895393d Actually fix win32 checkout test
It turns out that using REMOVE_UNTRACKED with checkout for this
particular test was causing the .gitattributes file to be removed
and so we do have to allow for the CRs in the created file...
2013-01-04 17:17:37 -08:00
Russell Belfer
bebdbcd442 Fix crlf issue with checkout tests
Move some checkout utility functions into a shared file and fix
some crlf filtering issues when verifying file contents.
2013-01-04 16:56:21 -08:00
Russell Belfer
817d625161 Fix checkout of index-only dirs and prefixed paths
There are a couple of checkout bugs fixed here.  One is with
untracked working directory entries that are prefixes of tree
entries but not in a meaningful way (i.e. "read" is a prefix of
"readme.txt" but doesn't interfere in any way).  The second bug
is actually a redo of 07edfa0fc640f85f95507c3101e77accd7d2bf0d
where directory entries in the index that are not in the diff
were not being removed correctly.  That fix remedied one case
but broke another.
2013-01-04 15:47:44 -08:00
Russell Belfer
7fc0043582 Add index API to remove all files in a directory
This adds the git_index_remove_directory API plus tests.
2013-01-04 15:47:44 -08:00
Russell Belfer
d8889d2b64 Fix checkout bug rmv untracked trees from index
When checking out with the GIT_CHECKOUT_REMOVE_UNTRACKED option
and there was an entire tree in the working directory and in the
index that is not in the baseline nor target commit, the tree was
correctly(?) removed from the working directory but was not
successfully removed from the index.  This fixes that and adds a
test of the functionality.
2013-01-04 15:47:44 -08:00
Russell Belfer
0d70f65051 Fixing checkout UPDATE_ONLY and adding tests
This adds a bunch of new checkout tests and in the process I found
a bug in the GIT_CHECKOUT_UPDATE_ONLY flag which I fixed.
2013-01-04 15:47:44 -08:00
Russell Belfer
b3fb9237c2 Clone should use GIT_CHECKOUT_SAFE_CREATE
For clone to work as expected, it should be using a SAFE_CREATE
checkout (i.e. create files that are missing, even if the target
tree matches the current HEAD).
2013-01-04 15:47:43 -08:00
Russell Belfer
c50c58decd Extend tests for checkout with typechanges
Test a number of other cases, including intentionally forced
conflicts and deeper inspection that trees get created properly.

There is a still a bug in checkout because the first test here
(i.e. test_checkout_typechange__checkout_typechanges_safe) should
be able to pass with GIT_CHECKOUT_SAFE as a strategy, but it will
not because of some lingering submodule checkout issues.
2013-01-04 15:47:43 -08:00
Russell Belfer
a6a82e1a59 Improve error propagation in stash
Stash was sometimes obscuring the actual error code, replacing it
with a -1 when there was more descriptive value.  This updates
stash to preserve the original error code more reliably along
with a variety of other error handling tweaks.

I believe this is an improvement, but arguably, preserving the
underlying error code may result in values that are harder to
interpret by the caller who does not understand the internals.
Discussion is welcome!
2013-01-04 15:47:42 -08: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
Russell Belfer
5cf9875a4f Add index updating to checkout
Make checkout update entries in the index for all files that are
updated and/or removed, unless flag GIT_CHECKOUT_DONT_UPDATE_INDEX
is given.  To do this, iterators were extended to allow a little
more introspection into the index being iterated over, etc.
2013-01-04 15:47:42 -08:00
Russell Belfer
7e5c8a5b41 More checkout improvements
This flips checkout back to be driven off the changes between
the baseline and the target trees.  This reinstates the complex
code for tracking the contents of the working directory, but
overall, I think the resulting logic is easier to follow.
2013-01-04 15:47:42 -08:00
Russell Belfer
cf20803170 Rework checkout internals (again)
I've tried to map out the detailed behaviors of checkout and make
sure that we're handling the various cases correctly, along with
providing options to allow us to emulate "git checkout" and "git
checkout-index" with the various flags.  I've thrown away flags
in the checkout API that seemed like clutter and added some new
ones.  Also, I've converted the conflict callback to a general
notification callback so we can emulate "git checkout" output and
display "dirty" files.

As of this commit, the new behavior is not working 100% but some
of that is probably baked into tests that are not testing the
right thing.  This is a decent snapshot point, I think, along the
way to getting the update done.
2013-01-04 15:47:42 -08:00
Jameson Miller
c5df10f4aa Failing test on git_checkout_tree when removing directories 2013-01-04 15:23:47 -08:00
Marvin Gülker
d0951175d4 Add failing test to demonstrate wrong checkout behaviour 2013-01-04 15:23:47 -08:00
Russell Belfer
e9e20c8474 Update cl_git_pass to return more info
This adds a failure reporting function that is called by
cl_git_pass which captures the actual error return code and
the error message if available in the failure report.
2013-01-04 15:23:47 -08:00
Vicent Marti
6040616214 clar: lolpython 2013-01-04 20:28:33 +01:00
Vicent Marti
3a4a961da5 clar: Corrupted pickles 2013-01-04 20:25:57 +01:00
Vicent Martí
c18a5ec58c Merge pull request #1174 from nulltoken/topic/soft_reset_with_index_conflicts
Prevent soft reset when index contains conflicts
2013-01-04 11:10:39 -08:00
Carlos Martín Nieto
702c3bf70e clar: make it compatible with python3 2013-01-04 19:03:02 +00:00
Vicent Marti
1d5d418671 clar: haha 2013-01-04 20:02:01 +01:00
Vicent Marti
73b58c9159 clar: fix warning on Windows 2013-01-04 20:00:09 +01:00
nulltoken
9a0d590412 reset: Cannot soft reset with a conflicted index 2013-01-04 18:43:34 +01:00
Vicent Martí
52ee071b35 Merge pull request #1189 from martinwoodward/tests-compliance
Add jGit license block to derrived tests
2013-01-04 09:33:54 -08:00
Martin Woodward
ba1a430a8b Add jGit license block to derrived tests
Add the jGit license block to tests derrived from jGit as per the
terms of the BSD license.
2013-01-04 17:29:45 +00:00
Vicent Marti
a7ffd936bf clar: fix merge/setup.c 2013-01-04 17:47:52 +01:00
Edward Thomson
5a62d659bc MERGE_HEAD contents iterator 2013-01-04 17:47:51 +01:00
Congyi Wu
d73d52dfcb Fix bug in gen_pktline() for deletes of missing remote refs
* gen_pktline() in smart_protocol.c was skipping refspecs that deleted
  refs that were not advertised by the server.  The new behavior is to
  send a delete command with an old-id of zero, which matches the behavior
  of the official git client.
* Update test_network_push__delete() in reaction to above fix.
* Obviate messy logic that handles missing push_spec rrefs by canonicalizing
  push_spec.  After calculate_work(), loid, roid, and rref, are filled in with
  exactly what is sent to the server
2013-01-04 17:47:51 +01:00
Nikolai Vladimirov
b60b4562fe add option to allow git note overwrite 2013-01-04 17:47:51 +01:00
Russell Belfer
b8a1ea7cf9 Fix core::env cleanup code
Mark fake home directories that failed to be created, so we won't
try to remove them and have cleanup just use p_rmdir.
2013-01-03 11:04:03 -08:00
Vicent Marti
54254a0fe2 Status tests... 2013-01-03 19:38:29 +01:00
Vicent Marti
7b51d675e8 Even more cleanups 2013-01-03 19:17:07 +01:00
Vicent Marti
f6fded8f91 Proper cleanup jeez 2013-01-03 19:07:41 +01:00
Ben Straub
600d8dbf6d Move test cleanup into cleanup functions 2013-01-03 09:10:38 -08:00
Ben Straub
bffbeebbec Cleanup after tests 2013-01-03 08:38:00 -08:00
Ben Straub
6fef1ab344 Tests should clean up after themselves 2013-01-03 07:47:51 -08:00
Nikolai Vladimirov
8716b499e2 add option to allow git note overwrite 2013-01-03 16:31:36 +02:00
Vicent Marti
7761ce2162 Merge branch 'development' into clar2
Conflicts:
	tests-clar/clone/nonetwork.c
	tests-clar/online/clone.c
	tests-clar/online/fetchhead.c
2013-01-03 04:24:12 +01:00
Vicent Marti
2e6f06a8d4 ...and add Clar raw 2013-01-03 02:34:45 +01:00
Vicent Marti
8ee7174be9 Remove the clar submodule 2013-01-03 02:22:42 +01:00
Vicent Marti
f46769e52a Fix network suite 2013-01-03 02:13:37 +01:00
Vicent Marti
6443eaf22f Disable Network suite by default 2013-01-03 00:50:29 +01:00
Ben Straub
922dd9788c Move some clone tests to the nonetwork suite 2013-01-02 13:54:37 -08:00
Vicent Martí
cd5ca5b97f Merge pull request #1152 from ben/clone-api-structification
Segregate in-memory and persisted remotes
2013-01-02 13:50:41 -08:00
Ben Straub
730df6d0f7 Include checkout options inline 2013-01-02 13:43:54 -08:00
Vicent Marti
39cd01779c This is a better name 2013-01-02 22:38:10 +01:00
Ben Straub
0642c1431e Move url to last place in parameter list 2013-01-02 12:44:47 -08:00
Vicent Marti
5c2d3f6d5d Add build dependency for clar. Also, fuck you CMake. Fuck you. 2013-01-02 04:19:13 +01:00
Vicent Marti
b0a4582975 Bump the Clar submodule 2013-01-02 02:05:11 +01:00
Vicent Marti
156cfec096 Cleanup Clar to make it SIMPLER 2013-01-02 02:05:11 +01:00
nulltoken
50a762a563 path: Teach UNC paths to git_path_dirname_r()
Fix libgit2/libgit2sharp#256
2012-12-26 23:07:25 +01:00
nulltoken
34b6f05f39 path: enhance git_path_dirname_r() test coverage 2012-12-26 11:59:07 +01:00
nulltoken
19c3c99ca8 remote: remove duplicated test 2012-12-24 18:18:40 +01:00
nulltoken
f19304d265 remote: Prevent create() from blindly overwriting 2012-12-24 18:18:31 +01:00
nulltoken
b0aa14aa3c remote: Enhance in-memory remote test coverage 2012-12-24 16:54:27 +01:00
nulltoken
6bd09ecc14 Fix MSSVC compilation issue 2012-12-24 16:54:26 +01:00
Ben Straub
2808ec9ab4 Rename test to make @nulltoken happy 2012-12-21 13:15:37 -08:00
Ben Straub
79000951ec In-memory remotes don't have names 2012-12-21 08:05:59 -08:00
Ben Straub
874dcb25eb Remote: deprecate dangling, prevent saving in-memory 2012-12-20 12:01:13 -08:00
Ben Straub
29f27599ea Rename remote creation APIs
git_remote_add -> git_remote_create
git_remote_new -> git_remote_create_inmemory
2012-12-20 10:52:57 -08:00
Ben Straub
621b50e4d5 Clone: trust but verify 2012-12-19 17:02:06 -08:00
Ben Straub
b412d56389 Add more clone options. Push test suite segfaults. 2012-12-19 17:02:06 -08:00
Edward Thomson
7fcec83428 fetchhead reading/iterating 2012-12-19 16:57:30 -06:00
Sascha Cunz
d5cf4665a9 Fix some leaks and (possibly) dangling pointers in tests
Also adds some asserts.
2012-12-19 08:04:31 +01:00
Sascha Cunz
96a289f5f3 clone-empty-test: Don't use one pointer for two things
... so we can clean up correctly.
2012-12-19 05:24:23 +01:00
Sascha Cunz
3dc0207bc0 revwalk-test: Don't leak the second repository 2012-12-19 05:22:46 +01:00
Sascha Cunz
26290cd13b Reset global variable to NULL after free'ing resource 2012-12-18 19:52:37 +01:00
Vicent Martí
e62171e2fc Merge pull request #1151 from arrbee/fix-diff-constructor-names
Fix diff constructor names
2012-12-17 11:10:25 -08:00
Russell Belfer
56c72b759c Fix diff constructor name order confusion
The diff constructor functions had some confusing names, where the
"old" side of the diff was coming after the "new" side.  This
reverses the order in the function name to make it less confusing.

Specifically...

* git_diff_index_to_tree becomes git_diff_tree_to_index
* git_diff_workdir_to_index becomes git_diff_index_to_workdir
* git_diff_workdir_to_tree becomes git_diff_tree_to_workdir
2012-12-17 11:00:53 -08:00
Vicent Martí
0d10e79dd9 Merge pull request #1149 from nulltoken/topic/blob_isbinary
Introduce git_blob_is_binary()
2012-12-17 10:13:36 -08:00
nulltoken
a3337f10bb blob: introduce git_blob_is_binary() 2012-12-17 17:20:31 +01:00
Sascha Cunz
22d23c61ed Cleanup the test correctly 2012-12-17 17:15:58 +01:00
Ben Straub
c4e3e797d1 Ensure static variables are nulled after every test 2012-12-16 12:27:11 -08:00
Ben Straub
a7f125cdba Fix fetchhead tests 2012-12-15 14:56:20 -08:00
Ben Straub
57f5d8dca5 Remove placeholder files during tests 2012-12-14 14:15:42 -08:00
Ben Straub
1164acde96 Rebase fixup 2012-12-14 14:00:35 -08:00
Ben Straub
850b1edfe8 Allow clone to handle empty repos 2012-12-14 13:58:44 -08:00
Ben Straub
b9e7e2b4e1 Move non-options back out of options struct 2012-12-14 13:46:45 -08:00
Ben Straub
18b2d560d3 Deploy git_clone_options; remove git_clone_bare 2012-12-14 13:03:59 -08:00
Vicent Marti
2d466b7dcb tests: Fix unused temp repo 2012-12-14 02:49:11 +01:00
Vicent Marti
509216a5b2 test: Fix clone tests 2012-12-14 02:49:01 +01:00
Vicent Marti
b0b9fd3245 Merge remote-tracking branch 'origin/clone-auth' into development 2012-12-14 02:41:53 +01:00
Jameson Miller
8a8820d89f Add test to clone with absolute path 2012-12-13 17:58:12 -05:00
Ben Straub
24393ea6d3 Stop premature remote freeing when cloning 2012-12-13 09:14:56 -08:00