From 4c375907c52debfff01b67f86094a6e03de633ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20David=20Ib=C3=A1=C3=B1ez?= Date: Sat, 19 Jul 2014 12:22:34 +0200 Subject: [PATCH] Make checkout to fail on unexpected options --- pygit2/repository.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pygit2/repository.py b/pygit2/repository.py index ae6b488..c17aeb4 100644 --- a/pygit2/repository.py +++ b/pygit2/repository.py @@ -177,7 +177,7 @@ class Repository(_Repository): # Checkout # @staticmethod - def _checkout_args_to_options(**kwargs): + def _checkout_args_to_options(strategy=None, directory=None): # Create the options struct to pass copts = ffi.new('git_checkout_options *') check_error(C.git_checkout_init_options(copts, 1)) @@ -188,11 +188,9 @@ class Repository(_Repository): # pygit2's default is SAFE_CREATE copts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE # and go through the arguments to see what the user wanted - strategy = kwargs.get('strategy') if strategy: copts.checkout_strategy = strategy - directory = kwargs.get('directory') if directory: target_dir = ffi.new('char[]', to_str(directory)) refs.append(target_dir)