Commit Graph

964 Commits

Author SHA1 Message Date
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