From 4c3271703d0f5c4cf87b07ac49a0515b71ce6d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jozef=20Steinh=C3=BCbl?= Date: Tue, 23 Jul 2024 18:13:38 +0200 Subject: [PATCH] fix: add push option only for specific providers --- src/cli/command/push.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/cli/command/push.c b/src/cli/command/push.c index 9760880..ada8732 100644 --- a/src/cli/command/push.c +++ b/src/cli/command/push.c @@ -34,7 +34,14 @@ int git_push(char *provider_name, char *branch_name, bool verbose) { char output[1024]; char command[256]; - snprintf(command, sizeof(command), "git push -o skip-ci gimi-%s %s 2>&1", + char push_option[50] = ""; + if (strcmp(provider_name, "sourcehut") == 0) { + strcat(push_option, " -o skip-ci"); + } else if (strcmp(provider_name, "gitlab") == 0) { + strcat(push_option, " -o ci.skip"); + } + + snprintf(command, sizeof(command), "git push%s gimi-%s %s 2>&1", push_option, provider_name, branch_name); file_ptr = popen(command, "r");