mirror of
https://github.com/xHyroM/gimi.git
synced 2024-11-21 23:41:06 +01:00
fix: push tags correctly
This commit is contained in:
parent
7031935db2
commit
f61fa52851
1 changed files with 14 additions and 11 deletions
|
@ -36,19 +36,22 @@ int git_push(char *provider_name, char *branch_name, bool tags, bool verbose) {
|
||||||
char output[1024];
|
char output[1024];
|
||||||
char command[256];
|
char command[256];
|
||||||
|
|
||||||
char push_args[50] = "";
|
char push_options[50] = "";
|
||||||
if (tags) {
|
if (strcmp(provider_name, "sourcehut") == 0) {
|
||||||
strcat(push_args, " --tags");
|
strcat(push_options, " -o skip-ci");
|
||||||
} else {
|
} else if (strcmp(provider_name, "gitlab") == 0) {
|
||||||
if (strcmp(provider_name, "sourcehut") == 0) {
|
strcat(push_options, " -o ci.skip");
|
||||||
strcat(push_args, " -o skip-ci");
|
|
||||||
} else if (strcmp(provider_name, "gitlab") == 0) {
|
|
||||||
strcat(push_args, " -o ci.skip");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(command, sizeof(command), "git push%s gimi-%s %s 2>&1", push_args,
|
char branch_or_tags[256] = "";
|
||||||
provider_name, branch_name);
|
if (tags) {
|
||||||
|
strcat(branch_or_tags, "--tags");
|
||||||
|
} else {
|
||||||
|
strcat(branch_or_tags, branch_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
snprintf(command, sizeof(command), "git push%s gimi-%s %s 2>&1", push_options,
|
||||||
|
provider_name, branch_or_tags);
|
||||||
|
|
||||||
file_ptr = popen(command, "r");
|
file_ptr = popen(command, "r");
|
||||||
if (file_ptr == NULL) {
|
if (file_ptr == NULL) {
|
||||||
|
|
Loading…
Reference in a new issue