PullRepository(): call fetch and merge
This commit is contained in:
		@@ -1001,9 +1001,25 @@ int GitLibrary::PushRepository(char const *localRepoName, char const *branchName
 | 
			
		||||
    return error;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int GitLibrary::PullRepository(char const *localRepoName, char const *branchName,
 | 
			
		||||
                               char const *userName, char const *userPassword) {
 | 
			
		||||
    // "git pull" is a basiclly a "git fetch" followed by a "git merge"
 | 
			
		||||
int GitLibrary::PullRepository(char const *localRepoName, char const *remoteRepoName) {
 | 
			
		||||
    // "git pull" is a basically 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;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user