From d883c838a77a430ada17e2e199ba5172dc4b5b35 Mon Sep 17 00:00:00 2001 From: czjstmax Date: Sat, 22 Nov 2025 17:40:50 +0100 Subject: test --- g.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'g.c') diff --git a/g.c b/g.c index 0727d28..e00aa49 100644 --- a/g.c +++ b/g.c @@ -387,21 +387,26 @@ int main(int argc, char **argv) { } } else if (matches(strn1, commit_vars) == 0) { if (strlen(strn2) == 0) { - // + system("git commit"); + return 0; } else if (strlen(strn2) > 0) { - // - } - if (matches(strn2, message_vars) == 0) { - if (strlen(strn3) == 0) { - // - } else if (strlen(strn3) > 0) { - // - } - } else if (matches(strn2, add_vars) == 0) { - if (strlen(strn3) == 0) { - // - } else if (strlen(strn3) > 0) { - // + if (matches(strn2, message_vars) == 0) { + if (strlen(strn3) == 0) { + // + } else if (strlen(strn3) > 0) { + char command_buffer[8192] = "git commit -m \""; + char command_buffer_post[] = "\""; + strcat(command_buffer, strn3); // git commit -m "msg + strcat(command_buffer, command_buffer_post); + system(command_buffer); // git commit -m "msg" + return 0; + } + } else if (matches(strn2, add_vars) == 0) { + if (strlen(strn3) == 0) { + // + } else if (strlen(strn3) > 0) { + // + } } } } -- cgit v1.3.1