51 Commits

Author SHA1 Message Date
J. David Ibáñez
611e979113 Now Repository.head returns a reference (#203)
Now Repository.head behaves like libgit2's git_repository_head, it
returns the resolved reference. These two lines are equivalent:

  ref = repo.head
  ref = repo.lookup_reference('HEAD').resolve()

Before it returned a commit.
2013-04-17 08:16:43 +02:00
J. David Ibáñez
c3ca27fa72 Merge branch 'master' into next
Conflicts:
	include/pygit2/types.h
	src/oid.c
2013-03-23 15:54:12 +01:00
Nico von Geyso
fa8ef0d6d4 Repository_read().data should be binary data 2013-03-12 23:50:44 +01:00
J. David Ibáñez
98013eb44d Support short (raw) oids 2013-03-10 12:26:32 +01:00
Nico von Geyso
da4abb78cb added test data for diff.find_similiar 2013-03-04 18:37:45 +01:00
J. David Ibáñez
29ce23c0d5 Update copyright 2013-03-02 12:16:16 +01:00
J. David Ibáñez
a96d494747 Coding style
Including:

- Lines longer than 79 chars
- Spaces at the end of line
- Wrong indentation
- Comma not followed by an space
- C++ style comments: //
2013-03-02 11:40:42 +01:00
Valentin Haenel
a41f59deb3 tests for keyword arg init_repository 2013-02-28 20:05:19 +01:00
Nico von Geyso
1b5bf479ff added functionality to checkout from index 2013-02-17 17:30:34 +01:00
Nico von Geyso
b828eb926f added functionality to checkout from HEAD 2013-02-17 17:30:34 +01:00
Nico von Geyso
db5e1443b6 added tests for Repo.checkout() 2013-02-17 17:30:34 +01:00
Nico von Geyso
c1e645ea1a moved remote tests to test_remote.py 2013-02-16 19:47:31 +01:00
Nico von Geyso
14a6734921 Added basic remote support
* new Repository methods implemented:
   * remotes to list all existing remotes
   * remote_create to create a new remote entry
* New Class Remote added
2013-02-15 18:08:38 +01:00
richo
4551cb078a Add tests for hash 2013-02-15 03:28:53 +11:00
richo
927b29d70e Add tests for Repository.hashfile 2013-02-15 03:28:52 +11:00
richo
3058181e14 Implement Iterator protocol on Repository
Uses a stupid implementation that builds a list in memory and returns
it's iterator.
2013-01-04 13:51:23 +11:00
delanne
0406841533 - thanks to Martin R. Hufsky for the patch for git_diff_find_similar
- I updated the unittest (they failed with the patch), and added a short unittest which emulates --find-copies-harder
2012-11-26 12:18:57 +01:00
J. David Ibáñez
af1c6ca10d Merge remote-tracking branch 'cholin/repo_state' 2012-11-16 16:55:34 +01:00
Nico von Geyso
7dbd08edc2 added in Repository: is_empty, is_bare, head_is_orphaned and head_is_detached 2012-11-01 16:17:51 +01:00
delanne
0b537bf780 - add option flags for tree.diff
- add a testcase test_diff_tree_opts
 - update testrepo.git
 - update existing testcases
2012-10-31 12:11:18 +01:00
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