29 Commits

Author SHA1 Message Date
J. David Ibáñez
29ce23c0d5 Update copyright 2013-03-02 12:16:16 +01:00
Nico von Geyso
929b775241 added Index_remove 2012-11-04 12:54:10 +01:00
Nico von Geyso
f1a72fb2e8 fixed index_add and index_get for current development branch of libgit2 2012-11-01 15:17:52 +01: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
J. David Ibáñez
e9e902e024 tests: add utility function 'oid_to_hex' 2012-02-27 00:12:33 +01:00
J. David Ibáñez
9d8d2ace64 index: implement Index.read_tree 2012-01-02 23:11:30 +01:00
J. David Ibáñez
550c966111 Rename Index.create_tree to Index.write_tree
Like Git command "git write-tree"
2012-01-02 20:10:28 +01:00
J. David Ibáñez
35ed84cf44 Update to latest changes in libgit2
Now Repository.index also works on bare repositories. Unit tests pass
again.

And fix a memory leak (add a call to git_index_free).
2012-01-02 19:42:49 +01: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
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
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
5cc4ba23d4 tests: replace xrange by range
This fixes one test with Python 3.
2011-08-16 22:54:05 +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
Julien Miotte
2093281110 Adding a test on IndexEntry 'mode' new attribute. 2011-07-12 18:53:29 +02:00
J. David Ibáñez
f55b001db9 Fix index iterator test 2011-05-11 17:18:23 +02:00
Jared Flatow
9dfc40e3f3 added iterator to index objects 2011-05-10 08:18:35 -07:00
J. David Ibáñez
6f2b864619 Change API to create Git objects
Do not allow to create commits, trees, blobs and tags directly from the
constructor. For instance, now calling "Commit(...)" raises an error.
Instead use the create methods of the repository object:

  Before                         Now
  -----------------------------  -----------------------------
  commit = Commit(repo, ...)     sha = repo.create_commit(...)
  tag = Tag(repo, ...)           sha = repo.create_tag(...)

Most often you won't need to get the object just created, but if you
do just call "repo[sha]" afterwards. (Methods to create blobs and trees
are still missing, just like before.)

Similarly the method that creates a tree object from the index file does
not return the tree object anymore, but just its SHA:

  Before                         Now
  -----------------------------  -----------------------------
  tree = index.create_tree()     sha = index.create_tree()
2011-04-11 18:44:49 +02:00
J. David Ibáñez
7947c5396c tests: remove unneeded calls to Index.read
Since libgit2's commit 3bdc0d4c8c3a5 the index file is automatically
read when opened.
2011-04-08 16:35:20 +02:00
Sarath Lakshman
014388c995 Add unit test for method create_tree() from Index class 2011-04-07 14:07:48 +05:30
J. David Ibáñez
08d3dcc82e Update unit tests 2011-04-05 12:37:26 +02:00
J. David Ibáñez
a1e79ded4e Merge remote branch 'davidv/index' 2011-03-03 19:52:32 +01:00
J. David Ibañez
0032573ca8 Add more unit tests for revision walking
Signed-off-by: J. David Ibañez <jdavid@itaapy.com>
2011-02-21 13:19:25 +01:00
David Versmisse
cde5b8b614 Add a default value for "stage" (0) in Index.add 2011-02-11 12:12:49 +01:00
J. David Ibañez
f643037b79 Add unit tests for the index file 2011-02-08 18:22:09 +01:00
J. David Ibañez
fe1540f546 Add index test case for a non-bare repo 2011-02-07 13:28:39 +01:00
J. David Ibañez
8c08923309 Start support for the index file 2011-02-07 12:39:57 +01:00