From 4c3c551f8176c52ed4b0d0043e3da7681ce4d1c2 Mon Sep 17 00:00:00 2001 From: Adrien Nader Date: Tue, 18 Mar 2025 15:21:43 +0100 Subject: [PATCH] doc: warn against using init_repository() to open a repository. It turns out this works in some situations but it should be avoided. --- pygit2/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pygit2/__init__.py b/pygit2/__init__.py index 01119bd7..e74eb9cd 100644 --- a/pygit2/__init__.py +++ b/pygit2/__init__.py @@ -106,6 +106,10 @@ def init_repository( The *workdir_path*, *description*, *template_path*, *initial_head* and *origin_url* are all strings. + If a repository already exists at *path*, it may be opened successfully but + you must not rely on that behavior and should use the Repository + constructor directly instead. + See libgit2's documentation on git_repository_init_ext for further details. """ # Pre-process input parameters