1336 Commits

Author SHA1 Message Date
J. David Ibáñez
f37cf25b8e Fix warning, and coding style a bit 2017-04-08 16:56:04 +02:00
J. David Ibáñez
11ff7a99eb Options, improve error messages 2017-04-08 11:16:15 +02:00
J. David Ibáñez
9335819795 Opening repos, raise more meaningful exceptions 2017-04-05 22:18:21 +02:00
Tamir Bahar
784583d21e Fixed indentation 2017-04-05 21:59:30 +03:00
Tamir Bahar
b81810e9cb Better error messages for opening repos.
Closes #645.
2017-04-05 20:59:36 +03:00
Tamir Bahar
7ee851273a Added explicit check for path = None in init_repository
Closes #688.
2017-04-05 16:37:25 +03:00
Nick Hynes
453fd8a9a3 Add docs 2017-03-27 17:10:51 -04:00
Nick Hynes
630d905e73 Add stash tests 2017-03-27 17:10:45 -04:00
Nick Hynes
9be907983f Wrap stash_pop 2017-03-27 16:42:38 -04:00
Nick Hynes
b31ac50210 Wrap stash_drop 2017-03-27 16:33:32 -04:00
Nick Hynes
da233b16c5 Wrap git_stash_apply 2017-03-27 16:31:21 -04:00
Nick Hynes
1a842ff8bd Wrap git_stash_save 2017-03-27 16:20:33 -04:00
Nick Hynes
cbbf9f1f87 Fix Signature._pointer 2017-03-27 16:18:21 -04:00
Nick Hynes
a294655aa5 Add declarations for git-stash 2017-03-27 16:18:13 -04:00
J. David Ibáñez
5a940987cd Add support for Python 3.6 2017-03-22 21:45:12 +01:00
J. David Ibáñez
354d56a95c Update copyright years 2017-03-22 21:15:34 +01:00
Jason Ziglar
8327e1bee3 Add test for init_submodules() and update_submodules() 2017-03-22 11:23:17 -04:00
Jason Ziglar
15326b731f Add update_submodules() command 2017-03-22 11:23:17 -04:00
Jason Ziglar
f5cd6da307 Add init_submodules() command 2017-03-22 11:23:17 -04:00
J. David Ibáñez
803b1cb154 cffi 1.10 not yet supported 2017-03-22 16:01:23 +01:00
J. David Ibáñez
d622e87654 test options, avoid side effects
This makes tests in PR#692 to pass
2017-03-22 13:38:11 +01:00
J. David Ibáñez
819cbff552 Remove some tabs 2017-02-09 17:31:50 +01:00
Matthaus Woolard
4fbc1f1c05 Add support for custom backends
Signed-off-by: Matthaus Woolard <matthaus.woolard@gmail.com>
2017-02-09 15:57:56 +00:00
Tamir Bahar
5c061cbb0a Remove unused code
Removed a chunk of code from `checkout` that did nothing, but had a bug.
When checking out from a branch-less state (like the state when a repository is first initialized) the code failed.
The failure was due to trying to get some properties of the current branch, which were never used in the code.
2017-01-03 01:17:48 +02:00
J. David Ibáñez
68817aad4f Release 0.25.0 v0.25.0 2016-12-26 12:30:36 +01:00
J. David Ibáñez
0b513d57fa Merge remote-tracking branch 'carlos/next' 2016-12-23 21:37:58 +01:00
Carlos Martín Nieto
074a726d7f Update versions to libgit2 v0.25.0 2016-12-23 20:24:37 +00:00
J. David Ibáñez
950249442e Merge remote-tracking branch 'bisho/master' 2016-12-20 20:02:47 +01:00
Guillermo Pérez
809fe33b8a Make pygit2 throw if tree of a commit is not found
Commit objects in git always have a tree_id associated, that points
to the corresponding Tree object.

When the tree object is missing, the repo is corrupted.

In those cases:
* official git cli fatals with status code 128 and message:
  fatal: unable to read tree <hash>
* libgit2 returns error GIT_ENOTFOUND when calling git_commit_tree()
* pygit2 when accessing the tree by id with repo[commit.tree_id]
raises a KeyError: <hash>

But on the other hand, on the commit object, rather than throwing
and exception, pygit2 is swallowing the error returned by libgit2
and setting the <Commit object>.tree property to None.

None is arguable the wrong choice to encode an error condition,
specially in python that is used heavily.

In particular this caused in our system to assume there was
an empty tree, and the sync service that tails git repo changes
decided to DELETE everything. The code was using None to
represent empty tree, usefull for example when we need to
compare a path between two commits (the path might be non-existant
at one of the commits you are comparing).

I think that in this case the right decision would be to raise
since is an exceptional case, caused by a corrupted repo,
is more consistent with other tools, and ensures user code
does not take the wrong decissions.

For curiosity the corrupted repository can happen more commonly
than expected. We run our repositories on a shared NFS filer,
and one of our servers didn't have the lookupcache=positive
flag. This makes NFS cache the metadata (files on a directory
for example) and use that for negative lookups (to deny existance
of files). In this case, the commit object was on a directory
not cached, so the commit was seen immediately, but the tree
object was in a folder that was cached, the cache didn't
contained the tree object, and thus for some seconds the tree
was not existing and the repo was corrupted. Our sync service
saw tree being None and decided to delete everything, causing
a lot of issues down the way.
2016-12-19 11:28:00 -08:00
Szucs Krisztian
6402302002 fixed cached memory tests 2016-12-03 14:01:39 +01:00
Szucs Krisztian
77f0585645 Added mwindow_mapped_limit, cached_memory, enable_caching, cache_max_size, cache_object_limit options 2016-12-03 13:52:19 +01:00
Carlos Martín Nieto
acdec78617 Update for v0.24+1 2016-11-14 16:40:36 +01:00
J. David Ibáñez
66280af83a Release 0.24.2 0.24.2 v0.24.2 2016-11-01 20:34:50 +01:00
J. David Ibáñez
b2a34bd901 Merge remote-tracking branch 'fourplusone/master' 2016-11-01 13:41:23 +01:00
Matthias Bartelmeß
44ef9ad2e9 Remove python 3.2 from appveyor file since it is not supported 2016-10-30 11:55:36 +01:00
Matthias Bartelmeß
db213113f4 Fix/appveyor all (#1)
* Create python-33.yml

* Delete python-33.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Update appveyor.yml

* Use weakref for conflicts caching

To prevent GC issues for python <= 3.3, use a weak reference for Index._conflicts

* Update index.py

* Update appveyor.yml
2016-10-30 12:52:25 +02:00
Robert Hölzl
ee28de65a0 Extend comment of Remote.push by note about push_update_reference.
As happened in support request https://github.com/libgit2/libgit2/issues/3963 it can be easily overseen,
that push returns True, when the remote has installed a hook that denies the commits.
2016-10-23 23:55:53 +02:00
Matthias Bartelmeß
825f3e45bd add slashes to URL if needed 2016-10-21 06:31:19 +03:00
Matthias Bartelmess
00dd78bf1b Fix windows tests 2016-10-21 06:06:40 +03:00
anatoly techtonik
e2393a5e24 appveyor.yml Fix nosetests report upload
/xunit/ endpoint in AppVeyor is made for uploading xUnit.net reports
http://help.appveyor.com/discussions/problems/5264-xunit-results-are-not-being-parsed
2016-10-18 13:51:03 +03:00
anatoly techtonik
da59cb1c92 appveyor.yml Attempt to fix test failure reporting
https://www.appveyor.com/docs/build-configuration/#script-blocks-in-build-configuration
2016-10-18 12:40:05 +03:00
anatoly techtonik
e873c6a363 appveyor.yml Attempt to fix test run
broken by 865c2f0
2016-10-15 20:17:28 +03:00
J. David Ibáñez
865c2f0e82 Revert "Update appveyor.yml"
This reverts commit faf6a63d25d9c12d7480e9b4faf4d6531b13b7c3.
2016-10-14 09:45:34 +02:00
J. David Ibáñez
6d6931cd26 Merge remote-tracking branch 'fourplusone/fix/windows-tests' 2016-10-13 12:26:19 +02:00
J. David Ibáñez
9b364dc7f3 Readme, badge to appveyor 2016-10-07 17:40:25 +02:00
Carlos Martín Nieto
578cf58cd7 Add Repository.create_reference to the automethod list 2016-10-03 20:31:56 +02:00
J. David Ibáñez
554f167353 Merge remote-tracking branch 'mrh/fix-non-ascii-errmsg' 2016-09-15 09:25:08 +02:00
mrh1997
54e4da837b Support non-english errors with non-ascii chars.
Libgit2 partially forwards OS error message texts.
On non-english Windows OSes these errors may contain non-ascii characters (i.e. umlauts).
To avoid that a UnicodeDecodeError is raised the error message is interpreted as UTF-8.
The solution should not be necessary on linux/osx as they return always ascii (as far as I know).
Thus this solution will not change the behaviour on linux/osx.
2016-09-13 22:31:49 +02:00
Matthias Bartelmeß
faf6a63d25 Update appveyor.yml 2016-07-24 22:57:05 +02:00
Matthias Bartelmeß
30980751cf Update appveyor.yml 2016-07-24 22:55:05 +02:00