From 3e937588c6fe36f5776dd1029a34132e0ec76db5 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Mon, 10 Feb 2025 22:17:48 +0300 Subject: add git feature It's available at compile-time --- src/lpass.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/lpass.c') diff --git a/src/lpass.c b/src/lpass.c index 229f3b6..f79c944 100644 --- a/src/lpass.c +++ b/src/lpass.c @@ -27,6 +27,7 @@ #include "exec-cmd.h" #include "xstd.h" #include "output.h" +#include "r-lg2.h" struct cmd_struct { const char *cmd; @@ -93,8 +94,20 @@ int main(int argc, char *argv[]) if(goto_maindir()) return 1; +#ifdef LIGBIT + result = lg2_open_repo("."); + if (result) { + print_error("Something went wrong with git\n"); + return 1; + } +#endif + struct cmd_struct *ptr = get_cmd(argv[1]); result = ptr ? ptr->func(--argc, ++argv) : cmd_help(argc, argv); +#ifdef LIGBIT + lg2_close_repo(); +#endif + return result; } \ No newline at end of file -- cgit v1.2.3-18-g5258