Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/libgit2/pygit2
/ functions
Functions
1,514 in github.com/libgit2/pygit2
⨍
Functions
1,514
◇
Types & classes
153
↳
Endpoints
3
↓ 157 callers
Function
Error_set
src/error.c:85
↓ 145 callers
Function
check_error
(err: int, io: bool = False)
pygit2/errors.py:35
↓ 101 callers
Function
to_bytes
( s: str | bytes | os.PathLike[str] | os.PathLike[bytes], encoding: str = 'utf-8', errors: str = '
pygit2/utils.py:55
↓ 97 callers
Function
option
( option_type: Literal[ Option.GET_MWINDOW_SIZE, Option.GET_MWINDOW_MAPPED_LIMIT,
pygit2/options.py:109
↓ 48 callers
Method
get
(self, key: str)
pygit2/branches.py:75
↓ 46 callers
Method
write
( self, data: bytes, src: FilterSource, write_next: Callable[[bytes], None],
test/test_filter.py:21
↓ 40 callers
Function
Object__load
src/object.c:57
↓ 40 callers
Function
git_oid_to_python
src/oid.c:40
↓ 40 callers
Method
status
Get the status of a submodule. Returns: A combination of SubmoduleStatus flags. Parameters: name Submo
pygit2/submodules.py:348
↓ 39 callers
Method
read
Update the contents of the Index by reading from a file. Parameters: force If True (the default) always reload.
pygit2/index.py:109
↓ 35 callers
Method
open
Open the repository for a submodule.
pygit2/submodules.py:63
↓ 35 callers
Method
string
String which was used to create this refspec
pygit2/refspec.py:57
↓ 33 callers
Method
create_reference
Create a new reference "name" which points to an object or to another reference. Based on the type and value of the target parameter,
pygit2/repository.py:320
↓ 32 callers
Function
check_args
(option: Option, arg1: Any, arg2: Any, expected: int)
pygit2/options.py:97
↓ 30 callers
Method
create
(self, name: str, commit: Commit, force: bool = False)
pygit2/branches.py:86
↓ 27 callers
Function
py_oid_to_git_oid
src/oid.c:88
↓ 26 callers
Method
exists
(self, ref: str)
test/test_refdb_backend.py:46
↓ 23 callers
Function
reference_is_valid_name
src/pygit2.c:239
↓ 22 callers
Method
diff
( self, a: None | str | bytes | Commit | Oid | Reference = None, b: None | str | bytes
pygit2/repository.py:564
↓ 21 callers
Method
add
Add or update an entry in the Index. If a path is given, that file will be added. The path must be relative to the root of the worktr
pygit2/index.py:208
↓ 20 callers
Function
diff_safeiter
In rare cases, Diff.__iter__ may yield None (see diff_get_patch_byindex). To make mypy happy, use this iterator instead of Diff.__iter__ to e
test/utils.py:106
↓ 19 callers
Method
diff_to_tree
Diff the index against a tree. Return a <Diff> object with the differences between the index and the given tree. Parameters
pygit2/index.py:310
↓ 19 callers
Method
merge_file_from_index
Merge files from index. Returns: A string with the content of the file containing possible conflicts if use_deprecated==True.
pygit2/repository.py:811
↓ 18 callers
Method
describe
Describe a commit-ish or the current working tree. Returns: The description (str). Parameters: committish : `str`,
pygit2/repository.py:1109
↓ 18 callers
Function
get_hello_txt_from_repo
()
test/test_repository.py:1071
↓ 18 callers
Method
lock_ref
Lock a reference in preparation for updating it. Args: refname: Name of the reference to lock (e.g., 'refs/heads/master')
pygit2/transaction.py:74
↓ 18 callers
Function
maybe_string
(ptr: 'char_pointer | None')
pygit2/utils.py:47
↓ 18 callers
Method
merge
Merges the given Reference or Commit into HEAD. Merges the given commit into HEAD, writing the results into the working directory.
pygit2/repository.py:984
↓ 18 callers
Method
rename
( self, old_name: str, new_name: str, force: bool, who: Signature, message: str )
test/test_refdb_backend.py:63
↓ 18 callers
Method
set_target
Set the target of a direct reference. The reference must be locked first via lock_ref(). Args: refname: Name of the refe
pygit2/transaction.py:88
↓ 16 callers
Method
amend_commit
Amend an existing commit by replacing only explicitly passed values, return the rewritten commit's oid. This creates a new c
pygit2/repository.py:1655
↓ 16 callers
Function
assertTreeEntryEqual
(entry: Object, sha: str, name: str, filemode: int)
test/test_tree.py:40
↓ 16 callers
Method
checkout
Checkout the given reference using the given strategy, and update the HEAD. The reference may be a reference name or a Refere
pygit2/repository.py:444
↓ 16 callers
Method
fetch
Perform a fetch against this remote. Returns a <TransferProgress> object. Parameters: prune : enums.FetchPrune *
pygit2/remotes.py:202
↓ 16 callers
Function
git_error_for_exc
src/error.c:138
↓ 16 callers
Method
transaction
Create a new reference transaction. Returns a context manager that commits all reference updates atomically when the context exits su
pygit2/repository.py:391
↓ 15 callers
Function
pgit_borrow_fsdefault
src/utils.c:66
↓ 14 callers
Method
push
Push the given refspec to the remote. Raises ``GitError`` on protocol error or unpack failure. When the remote has a githook
pygit2/remotes.py:343
↓ 13 callers
Function
py_oid_to_git_oid_expand
src/oid.c:101
↓ 13 callers
Function
wrap_reference
src/reference.c:725
↓ 13 callers
Method
write_tree
Create a tree out of the Index. Return the <Oid> object of the written tree. The contents of the index will be written out to the obj
pygit2/index.py:158
↓ 12 callers
Method
check_error
(self, error_code: int)
pygit2/callbacks.py:101
↓ 12 callers
Function
pygit2_enum
* Convert an integer to a reference to an IntEnum or IntFlag in pygit2.enums. */
src/utils.c:227
↓ 11 callers
Function
Error_set_str
src/error.c:105
↓ 11 callers
Method
delete
(self, ref_name: str, old_id: Oid | str, old_target: str | None)
test/test_refdb_backend.py:68
↓ 11 callers
Method
from_c
(cls, repo, ptr)
pygit2/index.py:63
↓ 11 callers
Method
update
Update a submodule. This will clone a missing submodule and checkout the subrepository to the commit specified in the index of the
pygit2/submodules.py:85
↓ 11 callers
Function
wrap_object
src/object.c:355
↓ 10 callers
Function
clone_repository
Clones a new Git repository from *url* in the given *path*. Returns: a Repository class pointing to the newly cloned repository. Parame
pygit2/__init__.py:462
↓ 10 callers
Method
hashfile
Calculate the hash of a file using repository filtering rules. If you simply want to calculate the hash of a file on disk with no filters,
pygit2/repository.py:187
↓ 10 callers
Function
init_repository
Creates a new Git repository in the given *path*. If *bare* is True the repository will be bare, i.e. it will not have a working copy.
pygit2/__init__.py:382
↓ 10 callers
Function
str_to_bytes
(value: str | PathLike[str] | bytes, name: str)
pygit2/config.py:46
↓ 10 callers
Function
to_unicode_n
src/utils.h:69
↓ 9 callers
Function
Error_set_oid
src/error.c:121
↓ 9 callers
Function
add_tag
(repo: Repository, name: str, target: str)
test/test_describe.py:35
↓ 9 callers
Method
lookup
(self, ref: str)
test/test_refdb_backend.py:49
↓ 9 callers
Function
to_str
(s: str | bytes | os.PathLike[str] | os.PathLike[bytes])
pygit2/utils.py:83
↓ 8 callers
Function
Object__id
src/object.c:71
↓ 8 callers
Function
build_signature
src/signature.c:318
↓ 8 callers
Method
resolve_refish
Convert a reference-like short name "ref-ish" to a valid (commit, reference) pair. If ref-ish points to a commit, the reference eleme
pygit2/repository.py:367
↓ 7 callers
Method
_from_c
(cls, centry)
pygit2/index.py:484
↓ 7 callers
Method
_to_c
Convert this entry into the C structure The first returned arg is the pointer, the second is the reference to the string we allocated
pygit2/index.py:468
↓ 7 callers
Method
get_multivar
Get each value of a multivar ''name'' as a list of strings. The optional ''regex'' parameter is expected to be a regular expression t
pygit2/config.py:182
↓ 7 callers
Method
listall_references
Return a list with all the references in the repository.
pygit2/repository.py:359
↓ 7 callers
Method
load_filter_list
Load the filter list for a given path. May return None if there are no filters to apply to this path. Parameters: p
pygit2/repository.py:240
↓ 7 callers
Function
to_unicode_safe
* Attempt to convert a C string to a Python string with the given encoding. * If the conversion fails, return a fallback string. */
src/utils.c:43
↓ 6 callers
Function
__option
(getter: Option, setter: Option, value: object)
test/test_options.py:35
↓ 6 callers
Method
_check_thread
Verify transaction is being used from the same thread that created it.
pygit2/transaction.py:64
↓ 6 callers
Method
_merge_options
Return a 'git_merge_opts *
pygit2/repository.py:786
↓ 6 callers
Method
blame
Return a Blame object for a single file. Parameters: path Path to the file to blame. flags
pygit2/repository.py:702
↓ 6 callers
Function
check_writing
( repo: Repository, treeish: str | Tree | Oid | Object, timestamp: int | None = None )
test/test_archive.py:35
↓ 6 callers
Method
get_attr
Retrieve an attribute for a file by path. Returns: a boolean, `None` if the value is unspecified, or string with the value o
pygit2/repository.py:1511
↓ 6 callers
Method
init
Just like "git submodule init", this copies information about the submodule into ".git/config". Parameters: overwri
pygit2/submodules.py:71
↓ 6 callers
Method
iterator
Creates a new iterator and fetches references for a given repository. Can also filter and pass all refs or only branches or only tags.
pygit2/references.py:63
↓ 6 callers
Method
list_heads
Get the list of references with which the server responds to a new connection. Parameters: callbacks : Passed to co
pygit2/remotes.py:249
↓ 6 callers
Function
pgit_borrow
* Return a borrowed c string with the representation of the given Unicode or * Bytes object: * - If value is Unicode return the UTF-8 representation
src/utils.c:139
↓ 6 callers
Function
read_content
(testrepo: Repository)
test/test_apply_diff.py:36
↓ 6 callers
Method
set_ident
Set the identity to be used for reference operations. Updates to some references also append data to their reflog. You can use this m
pygit2/repository.py:1590
↓ 5 callers
Method
add_all
Add or update index entries matching files in the working directory. If pathspecs are specified, only files matching those pathspecs will
pygit2/index.py:197
↓ 5 callers
Method
add_file
Add a config file instance to an existing config.
pygit2/config.py:252
↓ 5 callers
Method
cache_max_size
Set the maximum total data size that will be cached in memory across all repositories before libgit2 starts evicting objects
pygit2/settings.py:143
↓ 5 callers
Method
disable_pack_keep_file_checks
This will cause .keep file existence checks to be skipped when accessing packfiles, which can help performance with remote fi
pygit2/settings.py:135
↓ 5 callers
Method
has_log
(self, ref_name: str)
test/test_refdb_backend.py:74
↓ 5 callers
Method
merge_trees
Merge two trees. Returns: an Index that reflects the result of the merge. Parameters: ancestor The tre
pygit2/repository.py:927
↓ 5 callers
Method
read_tree
Replace the contents of the Index with those of the given tree, expressed either as a <Tree> object or as an oid (string or <Oid>). T
pygit2/index.py:132
↓ 5 callers
Method
remove
Remove an entry from the Index.
pygit2/index.py:181
↓ 5 callers
Method
stash
Save changes to the working directory to the stash. Returns: The Oid of the stash merge commit (Oid). Parameters:
pygit2/repository.py:1240
↓ 5 callers
Method
state
Determines the state of a git repository - ie, whether an operation (merge, cherry-pick, etc) is in progress. Returns a RepositorySta
pygit2/repository.py:679
↓ 5 callers
Method
with_commit
(self, commit: Commit | Oid | str | None)
pygit2/branches.py:104
↓ 5 callers
Function
wrap_diff
src/diff.c:54
↓ 4 callers
Function
Error_type
src/error.c:34
↓ 4 callers
Function
Error_type_error
src/error.c:131
↓ 4 callers
Method
__getitem__
(self, index: int)
pygit2/blame.py:133
↓ 4 callers
Function
_filter_fixture
(name: str, filter: type[Filter])
test/test_filter.py:60
↓ 4 callers
Method
_from_c
(cls, repo: Repository, ptr: 'GitBlameC')
pygit2/blame.py:121
↓ 4 callers
Method
_from_c
(cls, repo: BaseRepository, cptr: 'GitSubmoduleC')
pygit2/submodules.py:52
↓ 4 callers
Function
clear
(repo: Repository)
test/test_index.py:125
↓ 4 callers
Method
enable_caching
Enable or disable caching completely. Because caches are repository-specific, disabling the cache cannot immediately clear a
pygit2/settings.py:125
↓ 4 callers
Method
for_line
Returns the <BlameHunk> object for a given line given its number in the current Blame. Parameters: line_no
pygit2/blame.py:140
↓ 4 callers
Method
get_bool
Look up *key* and parse its value as a boolean as per the git-config rules. Return a boolean value (True or False). Truthy values are
pygit2/config.py:222
next →
1–100 of 1,514, ranked by callers