File indexing completed on 2024-04-28 16:01:31

0001 /******************************************************************************
0002  * This file is part of the libqgit2 library
0003  *
0004  * This library is free software; you can redistribute it and/or
0005  * modify it under the terms of the GNU Lesser General Public
0006  * License as published by the Free Software Foundation; either
0007  * version 2.1 of the License, or (at your option) any later version.
0008  *
0009  * This library is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012  * Lesser General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU Lesser General Public
0015  * License along with this library; if not, write to the Free Software
0016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
0017  */
0018 
0019 #ifndef LIBQGIT2_CHERRYPICKOPTIONS_H
0020 #define LIBQGIT2_CHERRYPICKOPTIONS_H
0021 
0022 #include "git2.h"
0023 #include <QSharedPointer>
0024 #include "qgitmergeoptions.h"
0025 #include "qgitcheckoutoptions.h"
0026 
0027 namespace LibQGit2
0028 {
0029     /**
0030      * Options that specify how a cherry-pick operation is performed.
0031      *
0032      * @ingroup LibQGit2
0033      * @{
0034      */
0035     class LIBQGIT2_EXPORT CherryPickOptions
0036     {
0037     public:
0038         /**
0039          * Constructs a new CherryPickOptions.
0040          * @param mergeOpts The merge options to use in the cherry-pick.
0041          * @param checkoutOpts The checkout options to use in the cherry-pick.
0042          */
0043         CherryPickOptions(const MergeOptions &mergeOpts = MergeOptions(), const CheckoutOptions &checkoutOpts = CheckoutOptions());
0044 
0045         /**
0046          * Sets the Mainline for the cherry-pick.
0047          *
0048          * Usually you cannot cherry-pick a merge because you do not know which side of the merge
0049          * should be considered the mainline. This parameter specifies the parent number (starting from 1)
0050          * of the mainline and allows cherry-pick to replay the change relative to the specified parent.
0051          * @param mainline The parent to use when cherry-picking a merge commit.
0052          */
0053         void setMainline(unsigned int mainline);
0054 
0055         const git_cherrypick_options* data() const;
0056 
0057     private:
0058         class Private;
0059         QSharedPointer<Private> d_ptr;
0060         Q_DECLARE_PRIVATE()
0061     };
0062 
0063     /** @} */
0064 
0065 }
0066 
0067 #endif // LIBQGIT2_CHERRYPICKOPTIONS_H