Commit Graph

65 Commits

Author SHA1 Message Date
Russell Belfer
4c47a8bcfe Merge pull request #968 from arrbee/diff-support-typechange
Support TYPECHANGE records in status and adjust checkout accordingly
2012-10-17 14:14:51 -07:00
nulltoken
b73200c1ed tags: cover EEXISTS propagation upon creation 2012-10-11 14:15:40 +02:00
Russell Belfer
0d64bef941 Add complex checkout test and then fix checkout
This started as a complex new test for checkout going through the
"typechanges" test repository, but that revealed numerous issues
with checkout, including:

* complete failure with submodules
* failure to create blobs with exec bits
* problems when replacing a tree with a blob because the tree
  "example/" sorts after the blob "example" so the delete was
  being processed after the single file blob was created

This fixes most of those problems and includes a number of other
minor changes that made it easier to do that, including improving
the TYPECHANGE support in diff/status, etc.
2012-10-09 11:59:34 -07:00
Sascha Cunz
8469219e37 Tests: Add test for git_tag_list to check for 'git tag -l "*bar"' 2012-09-23 01:02:07 +02:00
Sascha Cunz
daa70138fc Tests: reindent object/tag/list.c to use tabs 2012-09-23 01:02:07 +02:00
Sascha Cunz
45949b378b Tests::object::tag: also test for a 'foo/*/bar'. 2012-09-23 01:02:07 +02:00
Sascha Cunz
7604ddbf70 Tests: Add 3 tags to resources/testrepo.
Adjusts refs::list test (including the comments)
Adjusts objects::tags::list test
2012-09-23 01:02:07 +02:00
Sascha Cunz
e800bbe80a Tests::Object::Tag: Add a mechanism to test which tags were returned
This patch changes the tag listing test helper to use a struct as input
parameter, which tells what we exactly expect.

As I don't think, we can rely on the fact that every os and every
filesystem will report the tags in the same order, I made this code
independent of the order that the tags are retrieved.
2012-09-23 00:00:55 +02:00
Sascha Cunz
f73f760e66 Tests::Object::Tag: move listing tags tests to an own file 2012-09-22 23:12:03 +02:00
nulltoken
cf4c43abaa object: make git_object_peel() test more readable 2012-09-06 18:40:09 +02:00
Russell Belfer
d8057a5b0e Make git_object_peel a bit smarter
This expands the types of peeling that `git_object_peel` knows
how to do to include TAG -> BLOB peeling, and makes the errors
slightly more consistent depending on the situation.  It also
adds a new special behavior where peeling to ANY will peel until
the object type changes (e.g. chases TAGs to a non-TAG).

Using this expanded peeling, this replaces peeling code that was
embedded in `git_tag_peel` and `git_reset`.
2012-08-27 11:53:59 -07:00
nulltoken
9d7ac675d0 tree entry: rename git_tree_entry_attributes() into git_tree_entry_filemode() 2012-08-21 23:15:13 +02:00
nulltoken
a7dbac0b23 filemode: deploy enum usage 2012-08-21 23:15:10 +02:00
nulltoken
66439b0b1a treebuilder: enhance attributes handling on insertion 2012-08-19 14:11:59 +02:00
Carlos Martín Nieto
fc1826d149 tests: fix tree walking test
Return -1 to stop the iteration instead of not-0
2012-08-14 20:54:13 +02:00
Russell Belfer
85a0e28b80 Make git_message_prettify return bytes written
If you want to be absolutely safe with git_message_prettify, you
can now pass a NULL pointer for the buffer and get back the number
of bytes that would be copied into the buffer.

This means that an error is a non-negative return code and a
success will be greater than zero from this function.
2012-08-14 10:50:58 -07:00
Russell Belfer
fdc637c4e2 Check prettify message output buffer after cleanup
This makes the message prettify buffer length check accurate.
2012-08-12 09:08:45 -07:00
Vicent Marti
51e1d80846 Merge remote-tracking branch 'arrbee/tree-walk-fixes' into development
Conflicts:
	src/notes.c
	src/transports/git.c
	src/transports/http.c
	src/transports/local.c
	tests-clar/odb/foreach.c
2012-08-06 12:41:08 +02:00
Russell Belfer
b0d376695e Add new iteration behavior to git_tree_walk
Missed this one, ironically enough.
2012-08-03 17:24:59 -07:00
nulltoken
b8457baae2 portability: Improve x86/amd64 compatibility 2012-07-24 16:10:12 +02:00
nulltoken
db9be9457d object: introduce git_object_peel()
Partially fix #530
2012-07-17 20:32:40 +02:00
nulltoken
dc1f4b32d3 tree: unfound tree entry returns GIT_ENOTFOUND 2012-07-12 22:29:55 +02:00
Scott J. Goldman
7e8c146c6b Don't rmdir() nonexistent dirs in object::tree::frompath tests
It causes the clar testsuite to abort on Windows, and isn't necessary.
2012-06-29 00:47:46 -07:00
Vicent Marti
0e2fcca850 tree: Bring back entry_bypath
Smaller, simpler, faster.
2012-06-29 02:21:12 +02:00
nulltoken
743a4b3bdd message: Expose git_message_prettify()
git_commit() and git_tag() no longer prettify the
message by default. This has to be taken care of
by the caller.

This has the nice side effect of putting the
caller in position to actually choose to strip
the comments or not.
2012-06-19 10:02:22 +02:00
Vicent Marti
8c4c357f18 clar: Fix warnings 2012-06-19 02:43:36 +02:00
Vicent Marti
515a4c7c06 tree: Proper path comparison logic 2012-06-19 00:59:04 +02:00
Tim Clem
e00b56eb04 Fix broken tests caused by no longer prettifying by default 2012-06-15 10:18:08 -07:00
Vicent Martí
3f0358604e misc: Fix warnings from PVS Studio trial 2012-06-07 22:43:48 +02:00
nulltoken
cd44576790 blob: add git_blob_create_fromchunks() 2012-06-07 20:33:22 +02:00
Vicent Martí
904b67e69f errors: Rename error codes 2012-05-18 01:48:50 +02:00
Vicent Martí
e172cf082e errors: Rename the generic return codes 2012-05-18 01:26:26 +02:00
Vicent Martí
9d0011fd83 tree: Naming conventions 2012-05-16 19:24:35 +02:00
Vicent Martí
cedf9ca955 tree: Kill the git_tree_diff functions
These are deprecated and replaced with the diffing code in git2/diff.h
2012-05-16 19:24:35 +02:00
Carlos Martín Nieto
f0b350eb52 tests: make sure we clean up in objects/blob/write.c 2012-05-13 11:28:49 +02:00
nulltoken
6ca9643c96 blob: Add git_blob_create_fromdisk()
This function will create blobs in the object database from files anywhere on the filesystem. This can be run against bare and non-bare repositories.
2012-05-13 11:28:49 +02:00
nulltoken
e28c37761b object: make git_object_lookup() return GIT_ENOTFOUND when searching for an existing object by specifying an incorrect type
This fix complements cb0ce16bbe and cover the following additional use cases

 - retrieving an object which has been previously searched, found and cached
 - retrieving an object through an non ambiguous abbreviated id
2012-05-11 23:56:23 +02:00
Vicent Martí
c99bdacf71 Merge pull request #670 from nulltoken/ntk/topic/clean-commit_message
Clean commit and tag messages
2012-05-08 14:13:43 -07:00
Russell Belfer
19579847f6 Clean up warnings and tests 2012-05-08 13:23:00 -07:00
nulltoken
cb0ce16bbe object: make git_object_lookup() return GIT_ENOTFOUND when searching for an existing object by specifying an incorrect type 2012-05-08 10:05:14 +02:00
nulltoken
458b94503d commit/tag: ensure the message is cleaned up
'git commit' and 'git tag -a' enforce some conventions, like cleaning up excess whitespace and making sure that the last line ends with a '\n'. This fix replicates this behavior.

Fix libgit2/libgit2sharp#117
2012-05-07 12:16:04 +02:00
Vicent Martí
cd58c15c58 Merge remote-tracking branch 'scottjg/fix-mingw32' into development
Conflicts:
	src/netops.c
	src/netops.h
	src/transports/http.c
	tests-clar/clar
2012-05-05 16:47:20 -07:00
Scott J. Goldman
35cdd261f3 Fix unsigned/signed comparison on Windows in commitstagedfile.c 2012-05-05 13:54:33 -07:00
Vicent Martí
3fbcac89c4 Remove old and unused error codes 2012-05-02 19:56:38 -07:00
Vicent Martí
b02bcd97f8 Boom 2012-05-02 16:57:16 -07:00
Vicent Martí
a1d0802576 Backport more test data 2012-05-02 16:33:26 -07:00
Vicent Martí
946a6dc4e6 Update test suite 2012-05-02 16:14:30 -07:00
Vicent Martí
40879facad Merge branch 'new-error-handling' into development
Conflicts:
	.travis.yml
	include/git2/diff.h
	src/config_file.c
	src/diff.c
	src/diff_output.c
	src/mwindow.c
	src/path.c
	tests-clar/clar_helpers.c
	tests-clar/object/tree/frompath.c
	tests/t00-core.c
	tests/t03-objwrite.c
	tests/t08-tag.c
	tests/t10-refs.c
	tests/t12-repo.c
	tests/t18-status.c
	tests/test_helpers.c
	tests/test_main.c
2012-05-02 15:59:02 -07:00
Carlos Martín Nieto
3aa351ea0f error handling: move the missing parts over to the new error handling 2012-04-26 15:38:42 +02:00
nulltoken
3f46f313cb tag: Add git_tag_peel() which recursively peel a tag until a non tag git_object is met 2012-04-10 21:38:49 +02:00