Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Usage guide:
config
remotes
blame
settings


Indices and tables
Expand Down
8 changes: 8 additions & 0 deletions docs/settings.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**********************************************************************
Settings
**********************************************************************

.. contents::

.. autoclass:: pygit2.Settings
:members:
16 changes: 14 additions & 2 deletions pygit2/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,25 @@ def __setitem__(self, key, value):
option(GIT_OPT_SET_SEARCH_PATH, key, value)

class Settings(object):
"""Library-wide settings"""

__slots__ = ['mwindow_size', 'search_path']
__slots__ = []

search_path = SearchPathList()
_search_path = SearchPathList()

@property
def search_path(self):
"""Configuration file search path.

This behaves like an array whose indices correspond to the
GIT_CONFIG_LEVEL_* values. The local search path cannot be
changed.
"""
return self._search_path

@property
def mwindow_size(self):
"""Maximum mmap window size"""
return option(GIT_OPT_GET_MWINDOW_SIZE)

@mwindow_size.setter
Expand Down