Compare commits

..

2 Commits

Author SHA1 Message Date
a336b507fb forglobal defines 2024-04-05 11:10:12 +02:00
84c422ee38 just safe again 2024-04-03 16:40:46 +02:00
2 changed files with 57 additions and 0 deletions

View File

@ -340,8 +340,58 @@ on_error:
//
// git merge
//
struct merge_options { const char **heads;
size_t heads_count;
git_annotated_commit **annotated;
size_t annotated_count;
unsigned int no_commit : 1;
};
static void merge_options_init(struct merge_options *opts) {
memset(opts, 0, sizeof(*opts));
opts->heads = NULL;
opts->heads_count = 0;
opts->annotated = NULL;
opts->annotated_count = 0;
}
static void parse_options(const char **repo_path, struct merge_options *opts) {
#if 0
struct args_info args = ARGS_INFO_INIT;
for (args.pos = 1; args.pos < argc; ++args.pos) {
const char *curr = argv[args.pos];
if (curr[0] != '-') {
opts_add_refish(opts, curr);
} else if (!strcmp(curr, "--no-commit")) {
opts->no_commit = 1;
} else if (match_str_arg(repo_path, &args, "--git-dir")) {
continue;
}
}
#endif
}
static int merge(git_repository *repo) {
struct merge_options opts;
git_index *index;
git_repository_state_t state;
git_merge_analysis_t analysis;
git_merge_preference_t preference;
const char *path = ".";
int err = 0;
merge_options_init(&opts);
parse_options(&path, &opts);
cleanup:
free((char **)opts.heads);
free(opts.annotated);
return 0;
}

View File

@ -0,0 +1,7 @@
#ifndef GLOBAL_DEFINES_H_INCLUDED
#define GLOBAL_DEFINES_H_INCLUDED
#define HEADER __func__ << "(" << __LINE__ << ")"
#endif // GLOBAL_DEFINES_H_INCLUDED