MCPcopy Create free account
hub / github.com/libgit2/pygit2 / checkout_notify

Method checkout_notify

test/test_repository.py:562–571  ·  view source on GitHub ↗
(
            self,
            why: CheckoutNotify,
            path: str,
            baseline: Optional[DiffFile],
            target: Optional[DiffFile],
            workdir: Optional[DiffFile],
        )

Source from the content-addressed store, hash-verified

560 # define callbacks that raise an InterruptedError when checkout detects a conflict
561 class MyStashApplyCallbacks(pygit2.StashApplyCallbacks):
562 def checkout_notify(
563 self,
564 why: CheckoutNotify,
565 path: str,
566 baseline: Optional[DiffFile],
567 target: Optional[DiffFile],
568 workdir: Optional[DiffFile],
569 ) -> None:
570 if why == CheckoutNotify.CONFLICT:
571 raise InterruptedError('Applying the stash would create a conflict')
572
573 # overwrite hello.txt so that applying the stash would create a conflict
574 with hello_txt.open('w') as f:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected