#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "nilorea/n_common.h"
#include "nilorea/n_log.h"
#include "nilorea/n_str.h"
#include "nilorea/n_list.h"
#include "nilorea/n_git.h"
Go to the source code of this file.
|
| static void | cleanup_dir (const char *dir) |
| | Remove a directory tree recursively (simple rm -rf via system).
|
| |
| int | main (int argc, char **argv) |
| |
| void | process_args (int argc, char **argv) |
| |
| void | usage (void) |
| |
| static int | write_file (const char *dir, const char *filename, const char *content) |
| | Write a file inside the repo with given content.
|
| |
◆ cleanup_dir()
| static void cleanup_dir |
( |
const char * |
dir | ) |
|
|
static |
Remove a directory tree recursively (simple rm -rf via system).
- Parameters
-
- Examples
- ex_git.c.
Definition at line 110 of file ex_git.c.
Referenced by main().
◆ main()
| int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 117 of file ex_git.c.
References N_GIT_COMMIT_INFO::author, cleanup_dir(), N_STR::data, done, free_nstr, N_GIT_COMMIT_INFO::hash, list_destroy(), LOG_DEBUG, LOG_ERR, LOG_INFO, N_GIT_COMMIT_INFO::message, n_git_checkout_path(), n_git_close(), n_git_commit(), n_git_create_branch(), n_git_current_branch(), n_git_delete_branch(), n_git_diff_workdir(), n_git_init(), n_git_list_branches(), n_git_log(), n_git_stage(), n_git_status(), n_log, LIST::nb_items, process_args(), LIST_NODE::ptr, N_GIT_COMMIT_INFO::short_hash, LIST::start, write_file(), and N_STR::written.
◆ process_args()
| void process_args |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
◆ usage()
◆ write_file()
| static int write_file |
( |
const char * |
dir, |
|
|
const char * |
filename, |
|
|
const char * |
content |
|
) |
| |
|
static |
Write a file inside the repo with given content.
- Parameters
-
| dir | Repository directory path. |
| filename | Name of the file to write. |
| content | Content to write. |
- Returns
- 0 on success, -1 on failure.
- Examples
- ex_git.c.
Definition at line 96 of file ex_git.c.
Referenced by main().