mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-03 08:53:48 +00:00

Clay is the name of a programming language on the makings, and we want to avoid confusions. Sorry for the huge diff!
30 lines
491 B
C
30 lines
491 B
C
#include "clar_libgit2.h"
|
|
#include "posix.h"
|
|
|
|
void clar_on_init(void)
|
|
{
|
|
git_threads_init();
|
|
}
|
|
|
|
void clar_on_shutdown(void)
|
|
{
|
|
git_threads_shutdown();
|
|
}
|
|
|
|
void cl_git_mkfile(const char *filename, const char *content)
|
|
{
|
|
int fd;
|
|
|
|
fd = p_creat(filename, 0666);
|
|
cl_assert(fd != 0);
|
|
|
|
if (content) {
|
|
cl_must_pass(p_write(fd, content, strlen(content)));
|
|
} else {
|
|
cl_must_pass(p_write(fd, filename, strlen(filename)));
|
|
cl_must_pass(p_write(fd, "\n", 1));
|
|
}
|
|
|
|
cl_must_pass(p_close(fd));
|
|
}
|