я новичок в LibGit2Sharp и мне нужна помощь
я пытаюсь обнаружить, что локальное репо находится за удаленным репо - эквивалент git status
для моего тестового примера возвращает это:
On branch master
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
nothing to commit, working tree clean
он же: gut pull
требуется...
действительно уродливым решением было бы написать что-то вроде этого:
var workingTreeBeindOrigin = Process
.Start("git status")
.GetStdOutAsString() // not real code but u get the idea ...
.Contains("Your branch is behind")
но это всего лишь #$%^ ...
что я уже знаю:
using (var repo = new Repository(localRepositoryPath)) {
// this loads working tree changes - aka commit required
var status = repo.RetrieveStatus();
// this fetches data from remote but i dont what data or how to check remote status
string logMessage = "";
foreach (Remote remote in repo.Network.Remotes) {
IEnumerable<string> refSpecs = remote.FetchRefSpecs.Select(x => x.Specification);
Commands.Fetch(repo, remote.Name, refSpecs, null, logMessage);
}
// repo not showing any changes in watch window (mostly shows 'all threads needs to run' instead)
}
спасибо за любой пинок в правильном направлении...