Skip to content

Commit 4c3c551

Browse files
committed
doc: warn against using init_repository() to open a repository.
It turns out this works in some situations but it should be avoided.
1 parent db587ad commit 4c3c551

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pygit2/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ def init_repository(
106106
The *workdir_path*, *description*, *template_path*, *initial_head* and
107107
*origin_url* are all strings.
108108
109+
If a repository already exists at *path*, it may be opened successfully but
110+
you must not rely on that behavior and should use the Repository
111+
constructor directly instead.
112+
109113
See libgit2's documentation on git_repository_init_ext for further details.
110114
"""
111115
# Pre-process input parameters

0 commit comments

Comments
 (0)