summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 62d8632)
raw | patch | inline | side by side (parent: 62d8632)
author | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 27 Jan 2009 12:51:12 +0000 (13:51 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 27 Jan 2009 15:33:19 +0000 (16:33 +0100) |
tig.c | patch | blob | history |
index 6bbe2920ffda6167c4e5388c4fbbc07eff45ee27..8c65a4753bb9d2809a7bc93b23d43eb562b8884b 100644 (file)
--- a/tig.c
+++ b/tig.c
#define SIZEOF_TREE_ATTR \
STRING_SIZE("100644 blob ed09fe897f3c7c9af90bcf80cae92558ea88ae38\t")
-#define SIZEOF_TREE_PERM \
+#define SIZEOF_TREE_MODE \
STRING_SIZE("100644 ")
#define TREE_ID_OFFSET \
STRING_SIZE("100644 blob ")
-#define TREE_UP_FORMAT "040000 tree %s\t.."
-
struct tree_entry {
char id[SIZEOF_REV];
mode_t mode;
/* Strip the path part ... */
if (*opt_path) {
size_t pathlen = textlen - SIZEOF_TREE_ATTR;
- size_t striplen = strlen(opt_path);
+ size_t striplen = strlen(opt_path);
if (pathlen > striplen)
memmove(path, path + striplen,
return FALSE;
}
- type = text[STRING_SIZE("100644 ")] == 't'
- ? LINE_TREE_DIR : LINE_TREE_FILE;
-
+ type = text[SIZEOF_TREE_MODE] == 't' ? LINE_TREE_DIR : LINE_TREE_FILE;
entry = tree_entry(view, type, path, text, text + TREE_ID_OFFSET);
if (!entry)
return FALSE;
break;
default:
- return TRUE;
+ return REQ_NONE;
}
open_view(view, request, flags);
- if (request == REQ_VIEW_TREE) {
+ if (request == REQ_VIEW_TREE)
view->lineno = tree_lineno;
- }
return REQ_NONE;
}