/// <summary>
        /// Create wrapper around <see cref="GitCheckoutOpts"/> from <see cref="CheckoutOptions"/>.
        /// </summary>
        /// <param name="options">Options to create native GitCheckoutOpts structure from.</param>
        /// <param name="paths">Paths to checkout.</param>
        public GitCheckoutOptsWrapper(IConvertableToGitCheckoutOpts options, FilePath[] paths = null)
        {
            Callbacks = options.GenerateCallbacks();

            if (paths != null)
            {
                PathArray = GitStrArrayManaged.BuildFrom(paths);
            }

            Options = new GitCheckoutOpts
            {
                version           = 1,
                checkout_strategy = options.CheckoutStrategy,
                progress_cb       = Callbacks.CheckoutProgressCallback,
                notify_cb         = Callbacks.CheckoutNotifyCallback,
                notify_flags      = options.CheckoutNotifyFlags,
                paths             = PathArray.Array,
            };
        }
        /// <summary>
        /// Create wrapper around <see cref="GitCheckoutOpts"/> from <see cref="CheckoutOptions"/>.
        /// </summary>
        /// <param name="options">Options to create native GitCheckoutOpts structure from.</param>
        /// <param name="paths">Paths to checkout.</param>
        public GitCheckoutOptsWrapper(IConvertableToGitCheckoutOpts options, FilePath[] paths = null)
        {
            Callbacks = options.GenerateCallbacks();

            if (paths != null)
            {
                PathArray = GitStrArrayManaged.BuildFrom(paths);
            }

            Options = new GitCheckoutOpts
            {
                version = 1,
                checkout_strategy = options.CheckoutStrategy,
                progress_cb = Callbacks.CheckoutProgressCallback,
                notify_cb = Callbacks.CheckoutNotifyCallback,
                notify_flags = options.CheckoutNotifyFlags,
                paths = PathArray.Array,
            };
        }
Exemple #3
0
 internal FastForwardCheckoutOptionsAdapter(IConvertableToGitCheckoutOpts internalOptions)
 {
     this.internalOptions = internalOptions;
 }
 internal FastForwardCheckoutOptionsAdapter(IConvertableToGitCheckoutOpts internalOptions)
 {
     this.internalOptions = internalOptions;
 }