pull = fetch/merge

This commit is contained in:
Gerhard Hoffmann 2024-04-15 16:58:00 +02:00
parent 7aed1eed11
commit feeaab1ebe
3 changed files with 8 additions and 10 deletions

View File

@ -67,10 +67,8 @@ int PushRepositoryInternal(char const *localRepoName, char const *branchName,
return GitLibrary::PushRepository(localRepoName, branchName, userName, userPassword);
}
int PullRepositoryInternal(char const *localRepoName,
char const *branchName, char const *user,
char const *password) {
return GitLibrary::PullRepository(localRepoName, branchName, user, password);
int PullRepositoryInternal(char const *localRepoName, char const *remoteRepoName) {
return GitLibrary::PullRepository(localRepoName, remoteRepoName);
}
#include <local_git_repository.h>

View File

@ -33,7 +33,7 @@ int CloneRepositoryInternal(char const *url, char const *local_path) CALCULATOR_
int CheckoutRepositoryInternal(char const *url, char const *localRepoName, char const *branchName) CALCULATOR_C_INTERFACE_LIB_EXPORT;
int CommitFileInternal(char const *local_path, char const *branch_name, char const *file_name, char const *commit_message) CALCULATOR_C_INTERFACE_LIB_EXPORT;
int PushRepositoryInternal(char const *local_path, char const *branch_name, char const *user, char const *password) CALCULATOR_C_INTERFACE_LIB_EXPORT;
int PullRepositoryInternal(char const *localRepoName, char const *branchName, char const *user, char const *password) CALCULATOR_C_INTERFACE_LIB_EXPORT;
int PullRepositoryInternal(char const *localRepoName, char const *remoteRepoName) CALCULATOR_C_INTERFACE_LIB_EXPORT;
#ifdef __cplusplus
}

View File

@ -521,7 +521,7 @@ static int create_merge_commit(git_repository *repo, git_index *index, struct me
git_commit **parents = (git_commit **)calloc(opts->annotated_count + 1, sizeof(git_commit *));
if (!parents) {
qCritical() << HEADER << 'calloc failed';
qCritical() << HEADER << "calloc failed";
return -1;
}
@ -534,7 +534,7 @@ static int create_merge_commit(git_repository *repo, git_index *index, struct me
/* Grab our needed references */
check(git_repository_head(&head_ref, repo), "failed to get repo HEAD", NULL);
if (resolve_refish(&merge_commit, repo, opts->heads[0])) {
qCritical() << HEADER << QString("failed to resolve refish %s").args(opts->heads[0]);
qCritical() << HEADER << QString("failed to resolve refish %s").arg(opts->heads[0]);
free(parents);
return -1;
}
@ -642,7 +642,7 @@ static int merge(git_repository *repo) {
}
/* Since this is a fast-forward, there can be only one merge head */
target_oid = git_annotated_commit_id(opts.annotated[0]);
target_oid = git_annotated_commit_id(*opts.annotated);
assert(opts.annotated_count == 1);
return perform_fastforward(repo, target_oid, (analysis & GIT_MERGE_ANALYSIS_UNBORN));
@ -1013,7 +1013,7 @@ int GitLibrary::PullRepository(char const *localRepoName, char const *remoteRepo
if ((error = fetch(repo, remoteRepoName)) != 0) {
// error
}
if ((error = merge(repo) {
if ((error = merge(repo)) != 0) {
// error
}