Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
0e3a7a84e6 | |||
68634537c0 |
1
XD.1
1
XD.1
@ -24,6 +24,7 @@ c;l.
|
|||||||
:;default
|
:;default
|
||||||
\;;in a git repo
|
\;;in a git repo
|
||||||
8;in a git repo with stashed changes
|
8;in a git repo with stashed changes
|
||||||
|
X;in a git repo during a merge
|
||||||
B;in a git repo with no commits
|
B;in a git repo with no commits
|
||||||
.TE
|
.TE
|
||||||
.Ss Nose
|
.Ss Nose
|
||||||
|
13
XD.c
13
XD.c
@ -3,7 +3,10 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#if defined(ERR) || defined(EXPLAIN)
|
#ifdef ERR
|
||||||
|
#include <errno.h>
|
||||||
|
#endif
|
||||||
|
#if defined(EXPLAIN) || defined(ERR)
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -62,9 +65,12 @@ char
|
|||||||
struct stat s;
|
struct stat s;
|
||||||
int i, c;
|
int i, c;
|
||||||
|
|
||||||
|
|
||||||
/* find the number of jumps to the root of the fs */
|
/* find the number of jumps to the root of the fs */
|
||||||
rpath = realpath(path, NULL);
|
rpath = realpath(path, NULL);
|
||||||
|
if (!rpath) {
|
||||||
|
L("realpath: %s", strerror(errno));
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
for (i = c = 0; i < strlen(rpath); i++) {
|
for (i = c = 0; i < strlen(rpath); i++) {
|
||||||
if (rpath[i] == '/') {
|
if (rpath[i] == '/') {
|
||||||
c++;
|
c++;
|
||||||
@ -281,6 +287,9 @@ main(int argc, char *argv[])
|
|||||||
if (has_stashes(repo)) {
|
if (has_stashes(repo)) {
|
||||||
E("The current git repo has stashed changes.")
|
E("The current git repo has stashed changes.")
|
||||||
P("8"); /* goggle eyes if we have some stashed changes */
|
P("8"); /* goggle eyes if we have some stashed changes */
|
||||||
|
} else if (git_repository_state(repo) == GIT_REPOSITORY_STATE_MERGE) {
|
||||||
|
E("The current git repo is in the middle of a merge.")
|
||||||
|
P("X"); /* laughing eyes cause the user is fucked */
|
||||||
} else if (git_repository_is_empty(repo)) {
|
} else if (git_repository_is_empty(repo)) {
|
||||||
E("This is a new git repo.")
|
E("This is a new git repo.")
|
||||||
P("B"); /* sunglasses if we're in a new repo with no HEAD */
|
P("B"); /* sunglasses if we're in a new repo with no HEAD */
|
||||||
|
Reference in New Issue
Block a user