]> git.proxmox.com Git - libgit2.git/blobdiff - tests/index/nsec.c
New upstream version 1.4.3+dfsg.1
[libgit2.git] / tests / index / nsec.c
index 326b19540dc5d48ee1e9c15d2a24937a6d97deb6..3efd855a7e6d1772fc4c615cb457742f246235f0 100644 (file)
@@ -9,7 +9,7 @@ static git_index *repo_index;
 
 #define TEST_REPO_PATH "nsecs"
 
-// Fixture setup and teardown
+/* Fixture setup and teardown */
 void test_index_nsec__initialize(void)
 {
        repo = cl_git_sandbox_init("nsecs");
@@ -47,16 +47,16 @@ static bool try_create_file_with_nsec_timestamp(const char *path)
  */
 static bool should_expect_nsecs(void)
 {
-       git_buf nsec_path = GIT_BUF_INIT;
+       git_str nsec_path = GIT_STR_INIT;
        bool expect;
 
-       git_buf_joinpath(&nsec_path, clar_sandbox_path(), "nsec_test");
+       git_str_joinpath(&nsec_path, clar_sandbox_path(), "nsec_test");
 
        expect = try_create_file_with_nsec_timestamp(nsec_path.ptr);
 
-       p_unlink(nsec_path.ptr);
+       cl_must_pass(p_unlink(nsec_path.ptr));
 
-       git_buf_clear(&nsec_path);
+       git_str_dispose(&nsec_path);
 
        return expect;
 }
@@ -89,7 +89,7 @@ void test_index_nsec__staging_maintains_other_nanos(void)
        const git_index_entry *entry;
        bool expect_nsec, test_file_has_nsec;
 
-    expect_nsec = should_expect_nsecs();
+       expect_nsec = should_expect_nsecs();
        test_file_has_nsec = try_create_file_with_nsec_timestamp("nsecs/a.txt");
 
        cl_assert_equal_b(expect_nsec, test_file_has_nsec);