diff --git a/CalculatorCInterface/calculator_c_interface_lib.cpp b/CalculatorCInterface/calculator_c_interface_lib.cpp index 4e19095..470f5a2 100644 --- a/CalculatorCInterface/calculator_c_interface_lib.cpp +++ b/CalculatorCInterface/calculator_c_interface_lib.cpp @@ -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 diff --git a/CalculatorCInterface/calculator_c_interface_lib.h b/CalculatorCInterface/calculator_c_interface_lib.h index 3126ad9..83707af 100644 --- a/CalculatorCInterface/calculator_c_interface_lib.h +++ b/CalculatorCInterface/calculator_c_interface_lib.h @@ -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 } diff --git a/CalculatorCInterface/git_library.cpp b/CalculatorCInterface/git_library.cpp index db8e77f..77af17e 100644 --- a/CalculatorCInterface/git_library.cpp +++ b/CalculatorCInterface/git_library.cpp @@ -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,12 +1013,12 @@ 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 } if (repo) { - git_repository_free(repo); + git_repository_free(repo); } return error;