diff options
| author | dacctal <dacctal@symlinx.net> | 2026-05-24 10:23:38 +0000 |
|---|---|---|
| committer | dacctal <dacctal@symlinx.net> | 2026-05-24 10:23:38 +0000 |
| commit | aa0d78815004ae6b0c4a42b0e024f5c4ef555ae2 (patch) | |
| tree | 62f97b4c5acfdb98003568466f878fbd3d6b9dfb /src/is_updated.c | |
| parent | 83d471f2c1d1b1fa6be51f41e4f1c36ab19d7094 (diff) | |
c rewrite
Diffstat (limited to 'src/is_updated.c')
| -rw-r--r-- | src/is_updated.c | 20 |
1 files changed, 20 insertions, 0 deletions
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 <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <stdbool.h> +#include <unistd.h> + +#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 |
