File indexing completed on 2025-01-19 04:22:45

0001 /*
0002 SPDX-FileCopyrightText: 2021 Hamed Masafi <hamed.masfi@gmail.com>
0003 
0004 SPDX-License-Identifier: GPL-3.0-or-later
0005 */
0006 
0007 #include "stash.h"
0008 
0009 #include "gitmanager.h"
0010 #include <utility>
0011 
0012 namespace Git
0013 {
0014 Stash::Stash(Manager *git, QString name)
0015     : mGit(git)
0016     , mName(std::move(name))
0017 {
0018 }
0019 
0020 void Stash::apply()
0021 {
0022     mGit->runGit({QStringLiteral("stash"), QStringLiteral("apply"), mName});
0023 }
0024 
0025 void Stash::drop()
0026 {
0027     mGit->runGit({QStringLiteral("stash"), QStringLiteral("drop"), mName});
0028 }
0029 
0030 void Stash::pop()
0031 {
0032     mGit->runGit({QStringLiteral("stash"), QStringLiteral("pop"), mName});
0033 }
0034 
0035 const QString &Stash::name() const
0036 {
0037     return mName;
0038 }
0039 
0040 const QString &Stash::authorName() const
0041 {
0042     return mAuthorName;
0043 }
0044 
0045 const QString &Stash::authorEmail() const
0046 {
0047     return mAuthorEmail;
0048 }
0049 
0050 const QString &Stash::subject() const
0051 {
0052     return mSubject;
0053 }
0054 
0055 const QString &Stash::branch() const
0056 {
0057     return mBranch;
0058 }
0059 
0060 const QDateTime &Stash::pushTime() const
0061 {
0062     return mPushTime;
0063 }
0064 
0065 } // namespace Git