change libgit2 initialization
This commit is contained in:
12
XD.c
12
XD.c
@ -175,13 +175,8 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
#ifdef GIT
|
#ifdef GIT
|
||||||
git_repository *repo;
|
git_repository *repo;
|
||||||
int git_ok = 0;
|
|
||||||
|
|
||||||
if ((repo = init_git())) {
|
if ((repo = init_git())) {
|
||||||
git_ok = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (git_ok) {
|
|
||||||
/* change the eyes depending on the current git repo's status */
|
/* change the eyes depending on the current git repo's status */
|
||||||
if (has_stashes(repo)) {
|
if (has_stashes(repo)) {
|
||||||
P("8"); /* goggle eyes if we have some stashed changes */
|
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)) {
|
} else if (git_repository_head_detached(repo)) {
|
||||||
P("-"); /* add a minus nose when the HEAD is detached */
|
P("-"); /* add a minus nose when the HEAD is detached */
|
||||||
}
|
}
|
||||||
|
git_repository_free(repo);
|
||||||
|
git_libgit2_shutdown();
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
if (1) {
|
if (1) {
|
||||||
@ -222,9 +219,4 @@ main(int argc, char *argv[])
|
|||||||
} else {
|
} else {
|
||||||
P("|"); /* no code info */
|
P("|"); /* no code info */
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GIT
|
|
||||||
git_repository_free(repo);
|
|
||||||
git_libgit2_shutdown();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user