Commit 21ddeabe by Robert Coup

Review fixes:

- whitespace -> tabs
- comment style
- improve repo naming in merge/trees/analysis tests.
parent 7b27b6cf
// NOTE: this is the implementation for both merge/trees/analysis.c and merge/workdir/analysis.c
// You probably want to make changes to both files.
/*
NOTE: this is the implementation for both merge/trees/analysis.c and merge/workdir/analysis.c
You probably want to make changes to both files.
*/
#include "clar_libgit2.h"
#include "git2/repository.h"
......@@ -7,7 +9,7 @@
#include "git2/annotated_commit.h"
#include "git2/sys/index.h"
#include "merge.h"
#include "./merge_helpers.h"
#include "merge_helpers.h"
#include "refs.h"
#include "posix.h"
......
// NOTE: this is essentially duplicated from tests/merge/workdir/analysis.c
// You probably want to make changes to both files.
/*
NOTE: this is essentially duplicated from tests/merge/workdir/analysis.c
You probably want to make changes to both files.
*/
#include "clar_libgit2.h"
#include "git2/repository.h"
#include "../analysis.h"
static git_repository *base_repo;
static git_repository *repo;
static git_repository *bare_repo;
static git_index *repo_index;
#define TEST_REPO_PATH "merge-resolve"
......@@ -16,13 +18,13 @@ static git_index *repo_index;
/* Fixture setup and teardown */
void test_merge_trees_analysis__initialize(void)
{
base_repo = cl_git_sandbox_init(TEST_REPO_PATH);
repo = cl_git_sandbox_init(TEST_REPO_PATH);
cl_git_pass(git_repository_open_ext(&repo, TEST_REPO_PATH "/.git", GIT_REPOSITORY_OPEN_BARE, NULL));
cl_git_pass(git_repository_open_ext(&bare_repo, TEST_REPO_PATH "/.git", GIT_REPOSITORY_OPEN_BARE, NULL));
git_repository_index(&repo_index, repo);
git_repository_index(&repo_index, bare_repo);
testimpl_merge_analysis__initialize(repo, repo_index);
testimpl_merge_analysis__initialize(bare_repo, repo_index);
}
void test_merge_trees_analysis__cleanup(void)
......@@ -30,11 +32,13 @@ void test_merge_trees_analysis__cleanup(void)
testimpl_merge_analysis__cleanup();
git_index_free(repo_index);
repo_index = NULL;
git_repository_free(repo);
repo = NULL;
git_repository_free(bare_repo);
bare_repo = NULL;
cl_git_sandbox_cleanup();
repo = NULL;
}
void test_merge_trees_analysis__fastforward(void)
......
// NOTE: this is essentially duplicated with tests/merge/trees/analysis.c
// You probably want to make changes to both files.
/*
NOTE: this is essentially duplicated with tests/merge/trees/analysis.c
You probably want to make changes to both files.
*/
#include "clar_libgit2.h"
#include "git2/repository.h"
......@@ -26,7 +28,10 @@ void test_merge_workdir_analysis__cleanup(void)
testimpl_merge_analysis__cleanup();
git_index_free(repo_index);
repo_index = NULL;
cl_git_sandbox_cleanup();
repo = NULL;
}
void test_merge_workdir_analysis__fastforward(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment