From aa0d78815004ae6b0c4a42b0e024f5c4ef555ae2 Mon Sep 17 00:00:00 2001 From: dacctal Date: Sun, 24 May 2026 10:23:38 +0000 Subject: c rewrite --- src/is_updated.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/is_updated.c (limited to 'src/is_updated.c') diff --git a/src/is_updated.c b/src/is_updated.c new file mode 100644 index 0000000..29b482d --- /dev/null +++ b/src/is_updated.c @@ -0,0 +1,20 @@ +#include +#include +#include +#include +#include + +#include "is_updated.h" +#include "cmd_out.h" +#include "vars.h" + +bool is_updated(const char *src) { + if (src && strlen(src) > 0 && chdir(src) != 0) { + return false; + } + + char *output = cmd_out("git pull"); + bool result = (strstr(output, "Already up to date.") != NULL); + free(output); + return result; +} \ No newline at end of file -- cgit v1.2.3