Skip to content

Commit

Permalink
pygit2: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrifiro committed Jul 26, 2022
1 parent 45f515f commit ccca0f7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions scmrepo/git/backend/pygit2.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@
if TYPE_CHECKING:
from scmrepo.progress import GitProgressEvent

# NOTE: constant from libgit2 git2/checkout.h
# This can be removed after next pygit2 release:
# see https://github.com/libgit2/pygit2/pull/1087
GIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES = 1 << 18


class Pygit2Object(GitObject):
def __init__(self, obj):
Expand Down Expand Up @@ -138,7 +133,11 @@ def default_signature(self):

@staticmethod
def _get_checkout_strategy(strategy: Optional[int] = None):
from pygit2 import GIT_CHECKOUT_RECREATE_MISSING, GIT_CHECKOUT_SAFE
from pygit2 import (
GIT_CHECKOUT_RECREATE_MISSING,
GIT_CHECKOUT_SAFE,
GIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES,
)

if strategy is None:
strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_RECREATE_MISSING
Expand Down

0 comments on commit ccca0f7

Please sign in to comment.