Git: Show upstream status for tracked branches

The Branch View now shows how many commmits
a branch is ahead and behind its tracking
branch.

Example:

  master ↑1 ↓15 [origin/master]

Change-Id: I9564efdfe82154cd98b9856313170aacad036f0c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Andre Hartmann
2019-12-13 22:36:01 +01:00
committed by André Hartmann
parent 4a8e8f2b6e
commit 31e9c93b6b
3 changed files with 50 additions and 4 deletions

View File

@@ -93,6 +93,16 @@ public:
using SubmoduleDataMap = QMap<QString, SubmoduleData>;
class UpstreamStatus
{
public:
UpstreamStatus() = default;
UpstreamStatus(int ahead, int behind) : ahead(ahead), behind(behind) {}
int ahead = 0;
int behind = 0;
};
class GitClient : public VcsBase::VcsBaseClientImpl
{
Q_OBJECT
@@ -338,6 +348,8 @@ public:
void show(const QString &source, const QString &id, const QString &name = QString());
void archive(const QString &workingDirectory, const QString &commit);
VcsBase::VcsCommand *asyncUpstreamStatus(const QString &workingDirectory,
const QString &branch, const QString &upstream);
private:
void finishSubmoduleUpdate();
void chunkActionsRequested(QMenu *menu, int fileIndex, int chunkIndex,