gitremote.cpp 456 B

12345678910111213141516171819
  1. #include "gitremote.h"
  2. #include <git2/remote.h>
  3. GitRemote::GitRemote(git_remote* raw, GitRepository* parent) : GitBase(raw, parent)
  4. {
  5. }
  6. GitRemote* GitRemote::fromName(const QString& remoteName, GitRepository* parent)
  7. {
  8. git_remote* remote = nullptr;
  9. git_remote_lookup(&remote, parent->raw(), remoteName.toUtf8().data());
  10. return new GitRemote(remote, parent);
  11. }
  12. QString GitRemote::name() const
  13. {
  14. return QString(git_remote_name(raw()));
  15. }