31 Commits

Author SHA1 Message Date
J. David Ibáñez
5251343ee7 Merge remote-tracking branch 'wking/revparse' 2012-09-25 15:10:55 +02:00
J. David Ibáñez
430f4dc343 Fix typo in repository test 2012-09-14 14:04:02 +02:00
W. Trevor King
0238fb72df repository: add Repository.revparse_single().
This provides access to libgit2's 'git_revparse_single'.
2012-09-13 17:09:12 -04:00
W. Trevor King
437c1af33f test_repository: fix HEAD_SHA -> 2cdae2 and use assertEqual when testing.
The previous test always passed, because bool(HEAD_SHA) is True.

The update to HEAD_SHA should have happened in:

  commit c06e10e67e746099b8d454212acc56391199eb31
  Author: Petr Hosek <p.hosek@imperial.ac.uk>
  Date:   Tue May 29 17:41:07 2012 +0100

    Support for diff merge operation added
2012-09-13 16:54:07 -04:00
J. David Ibáñez
edcd803e7e Remove the __authors__ var from py files 2012-07-18 12:12:04 +02:00
J. David Ibáñez
6195491596 Add/update copyright header of each file
And update my email address.
2012-07-18 12:07:17 +02:00
Nico von Geyso
eb62331b36 added missing tests 2012-05-30 08:32:13 +02:00
Carlos Martín Nieto
7137f8217e Add tests for the short OID support 2012-03-15 05:33:13 +01:00
Amit Bakshi
b1cb51c9d1 Test for pygit2.discover_repository 2012-02-25 18:15:45 -08:00
J. David Ibáñez
01cb80b4c8 errors: pass through git_lasterror in several places
And clean up related code a little bit.
2011-12-06 23:36:20 +01:00
J. David Ibáñez
3037d26c9d Fix unit tests with Python 3.2 2011-11-27 10:05:58 +01:00
Hugh Cole-Baker
160cf64abc Add support for using short hex string prefixes
Allows Repository_getitem, Repository_read(_raw), Repository_create_commit,
Repository_create_tag and Object_read_raw to use short hex strings to
lookup objects.
Also test getting objects from Repository using prefixes, looking up commit
trees and parents by hex prefix, and looking up tag targets by prefix.
Also stop raising TypeError if passing a too-short hex prefix to the
lookup functions, instead use ValueError.
2011-10-22 22:01:16 +01:00
J. David Ibáñez
af983b989a tests: fixing issue #20
There were two problems:

- Windows refuses to remove a file that is in use. Solution, close
  the repo before cleaning the temporary directory.

- Windows refuses to remove a read-only file. Solution, change mode
  to writable.
2011-10-17 20:44:54 +02:00
J. David Ibáñez
83642a6954 Rename '.sha' to '.hex' 2011-09-02 16:53:17 +02:00
J. David Ibáñez
54dd6714f2 Methods to create objects return raw oid
Now methods that create new objects return the raw oid instead of the
hexadecimal form.
2011-09-02 15:43:44 +02:00
Josh Bleecher Snyder
0b23ea3fea Use realpath instead of abspath to properly handle symlinked temp dirs
Fixes issue #47
2011-08-31 15:51:42 -07:00
J. David Ibáñez
f09a02a2ee Use UTF-8 encoding in all Python files 2011-08-24 07:42:05 +02:00
J. David Ibáñez
fd5aab4e56 tests: minor coding style fix, use 4 spaces indent 2011-08-24 07:32:21 +02:00
J. David Ibáñez
d863a8ea17 Remove broken test with Python 3
Now all tests pass with Python 3.
2011-08-24 07:30:09 +02:00
J. David Ibáñez
b84b79acd8 Fix running the tests with Python 3
Now "python3 setup.py test" works.
2011-08-24 00:07:20 +02:00
J. David Ibáñez
ae1d178d7a Fix most unit tests with Python 3 2011-08-21 00:54:57 +02:00
J. David Ibáñez
585ce44c21 tests: fix last test for Python 2 2011-08-19 21:38:48 +02:00
J. David Ibáñez
7950ee1116 Use Python 3 string literals for the unit tests
Now unit tests are broken.
2011-08-13 22:48:23 +02:00
Petr Viktorin
bfd20dc4b4 Somewhat better test coverage
- create_repository
- IndexEntry.path
- Correct SHAs in Index iteration
- Opening a bare index & attempting to add to it
- Walker.reset
- Walker.push
- Walker.sort
2011-08-08 23:42:01 +02:00
J. David Ibáñez
dafe4b11b2 Fix coding style
- do not use tabs
- remove trailing white spaces
- lines are 79 chars max.
2011-07-20 15:05:17 +02:00
Sebastian Thiel
d0bc776121 Repository.write implemented
Implemented Repository write function, using odb write streams
Added simple test
2011-07-18 17:02:26 +02:00
Sebastian Thiel
cf37c15059 allow 20 byte sha strings
Adjusted py_str_to_git_oid to allow 20 byte binary strings. This improves usability to other clients which already store their shas as binary strings, increasing overall performance as they won't have to convert them into hex beforehand, which would have to be converted back to binary form by libgit2 in turn.
Adjusted tests to accept binary shas.
2011-07-08 17:05:33 +02:00
David Versmisse
bed8c13757 Add the "getters" Repository.path and Repository.workdir 2011-04-29 09:21:01 +02:00
J. David Ibañez
fe1540f546 Add index test case for a non-bare repo 2011-02-07 13:28:39 +01:00
Dave Borowitz
673a045a30 Add KeyError assert to test_repository.
Change-Id: Ifd29be456c61fdd476a3298b1ead110283d2424e
2010-11-12 13:28:48 -08:00
Dave Borowitz
a2b0f45368 Add simple repository tests.
Change-Id: I128ac826f1c673002bc6f17696691e5a4bd7f0fd
2010-11-12 13:19:57 -08:00