1363 Commits

Author SHA1 Message Date
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
Matthias Bartelmeß
dae61ded38 Update appveyor.yml 2016-07-24 22:52:41 +02:00
Matthias Bartelmeß
0e270c72bd Update appveyor.yml 2016-07-24 22:12:00 +02:00
Matthias Bartelmeß
1afbde0d7f install dependencies in init script 2016-07-24 21:56:21 +02:00
Matthias Bartelmeß
7fe7a4da8d Remove qoutes from env vars 2016-07-24 21:50:17 +02:00
Matthias Bartelmeß
fd1e9e3d35 Update appveyor.yml
upload test results
2016-07-24 15:54:54 +02:00
Matthias Bartelmeß
cdd57b2c0f make sure the repo object will be collected before the repo is removed 2016-07-22 10:46:11 +02:00
mrh1997
ffc514fa24 Ammend the doc-string of Repository.diff()
According to the old documentation, it was not clear how to compare 
working directory/index to a git object.
2016-07-11 14:41:39 +02:00
Matthias Bartelmeß
c57a3aeb22 install locally 2016-07-03 17:01:26 +02:00
Matthias Bartelmeß
ca444f3c7d Update appveyor.yml 2016-07-03 16:54:40 +02:00
Matthias Bartelmeß
96beae5c82 fix yaml error 2016-07-03 16:15:41 +02:00
Matthias Bartelmeß
68de0f8bb6 fix yaml error 2016-07-03 16:14:26 +02:00
Matthias Bartelmeß
df53551cb2 Build 32 and 64 bit version 2016-07-03 16:13:21 +02:00
Matthias Bartelmeß
5864b17b57 archive wheels 2016-07-03 16:03:05 +02:00
Matthias Bartelmeß
6c4fa88d07 using cd,cd .. instead of popd 2016-07-03 15:49:39 +02:00
Matthias Bartelmeß
e96d0286b8 Create appveyor.yml 2016-07-03 15:41:23 +02:00
J. David Ibáñez
4fa43e234e docs, update version 2016-06-21 23:15:56 +02:00
J. David Ibáñez
4416f65fe1 Release 0.24.1 0.24.1 v0.24.1 2016-06-21 23:04:12 +02:00
Ondřej Nový
5dcc793aff Make build reproducible
https://wiki.debian.org/ReproducibleBuilds
2016-06-07 22:33:46 +02:00
J. David Ibáñez
30f539ff35 Merge remote-tracking branch 'seanfarley/smf/pygit2-upgrade' 2016-06-02 16:18:07 +02:00
Carlos Martín Nieto
df30f9213f Remove checks for obsolete methods
This is not how you define your callbacks, so this test isn't testing
for anything useful.
2016-04-29 13:19:32 +02:00
Ondřej Nový
50c0569cf0 Fixed typo 2016-04-18 21:58:58 +02:00
J. David Ibáñez
d8fd2e78d8 Merge remote-tracking branch 'ignatenkobrain/gh620' 2016-04-17 20:48:56 +02:00
Igor Gnatenko
fd9a39a91b repository: decode() linkname
Reference: https://github.com/libgit2/pygit2/issues/620
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
2016-04-15 14:13:47 +02:00