PullRepository(): call fetch and merge

This commit is contained in:
Gerhard Hoffmann 2024-04-15 16:41:11 +02:00
parent fe46da5417
commit d8de4e070e

View File

@ -1001,9 +1001,25 @@ int GitLibrary::PushRepository(char const *localRepoName, char const *branchName
return error; return error;
} }
int GitLibrary::PullRepository(char const *localRepoName, char const *branchName, int GitLibrary::PullRepository(char const *localRepoName, char const *remoteRepoName) {
char const *userName, char const *userPassword) { // "git pull" is a basically a "git fetch" followed by a "git merge"
// "git pull" is a basiclly a "git fetch" followed by a "git merge" git_repository *repo = nullptr;
int error = 0;
return 0; if ((error = git_repository_open(&repo, localRepoName)) != 0) {
// error
}
// remoteRepoName typically "origin"
if ((error = fetch(repo, remoteRepoName)) != 0) {
// error
}
if ((error = merge(repo) {
// error
}
if (repo) {
git_repository_free(repo);
}
return error;
} }