PullRepository(): call fetch and merge
This commit is contained in:
parent
fe46da5417
commit
d8de4e070e
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user