diff options
author | Squibid <me@zacharyscheiman.com> | 2024-12-21 21:32:39 -0500 |
---|---|---|
committer | Squibid <me@zacharyscheiman.com> | 2024-12-21 21:32:39 -0500 |
commit | 2dc0d582e6d385e05dadf844381d92a75cc1bf6f (patch) | |
tree | 2e7e585cbaa590a56f521e93649cbb0cfd51e67e /XD.c | |
parent | 2a6385fa36106f3fc9c23b705a3cca1d31f196f5 (diff) | |
download | XD-2dc0d582e6d385e05dadf844381d92a75cc1bf6f.tar.gz XD-2dc0d582e6d385e05dadf844381d92a75cc1bf6f.tar.bz2 XD-2dc0d582e6d385e05dadf844381d92a75cc1bf6f.zip |
change libgit2 initialization
Diffstat (limited to '')
-rw-r--r-- | XD.c | 12 |
1 files changed, 2 insertions, 10 deletions
@@ -175,13 +175,8 @@ main(int argc, char *argv[]) #ifdef GIT git_repository *repo; - int git_ok = 0; if ((repo = init_git())) { - git_ok = 1; - } - - if (git_ok) { /* change the eyes depending on the current git repo's status */ if (has_stashes(repo)) { P("8"); /* goggle eyes if we have some stashed changes */ @@ -199,6 +194,8 @@ main(int argc, char *argv[]) } else if (git_repository_head_detached(repo)) { P("-"); /* add a minus nose when the HEAD is detached */ } + git_repository_free(repo); + git_libgit2_shutdown(); } else #endif if (1) { @@ -222,9 +219,4 @@ main(int argc, char *argv[]) } else { P("|"); /* no code info */ } - - #ifdef GIT - git_repository_free(repo); - git_libgit2_shutdown(); - #endif } |