summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5c4358d)
raw | patch | inline | side by side (parent: 5c4358d)
author | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 29 May 2007 14:11:58 +0000 (16:11 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 29 May 2007 14:20:20 +0000 (16:20 +0200) |
Similar to notice for blob view, mention when there is no pager content
to view and suggest the user to open the prompt to run a command.
to view and suggest the user to open the prompt to run a command.
tig.c | patch | blob | history |
index 4b4a8c201317be91a8ccaa0d43f1a895dbbe53e1..dde4369f183744548ce57e4c3b98c707919d387b 100644 (file)
--- a/tig.c
+++ b/tig.c
#define string_ncopy(dst, src, srclen) \
string_ncopy_do(dst, sizeof(dst), src, srclen)
+#define string_copy_rev(dst, src) \
+ string_ncopy_do(dst, SIZEOF_REV, src, SIZEOF_REV - 1)
+
static char *
chomp_string(char *name)
{
view->offset = 0;
view->lines = 0;
view->lineno = 0;
- string_copy(view->vid, id);
+ string_copy_rev(view->vid, id);
if (view->line) {
int i;
char *text = line->data + STRING_SIZE("commit ");
if (view != VIEW(REQ_VIEW_PAGER))
- string_copy(view->ref, text);
- string_copy(ref_commit, text);
+ string_copy_rev(view->ref, text);
+ string_copy_rev(ref_commit, text);
}
}
char *text = line->data + STRING_SIZE("100644 blob ");
if (line->type == LINE_TREE_FILE) {
- string_ncopy(ref_blob, text, 40);
+ string_copy_rev(ref_blob, text);
} else if (line->type != LINE_TREE_DIR) {
return;
}
- string_ncopy(view->ref, text, 40);
+ string_copy_rev(view->ref, text);
}
static struct view_ops tree_ops = {
line += STRING_SIZE("commit ");
view->line[view->lines++].data = commit;
- string_copy(commit->id, line);
+ string_copy_rev(commit->id, line);
commit->refs = get_refs(commit->id);
graph->commit = commit;
break;
{
struct commit *commit = line->data;
- string_copy(view->ref, commit->id);
- string_copy(ref_commit, view->ref);
+ string_copy_rev(view->ref, commit->id);
+ string_copy_rev(ref_commit, view->ref);
}
static struct view_ops main_ops = {
ref->name[namelen] = 0;
ref->tag = tag;
ref->remote = remote;
- string_copy(ref->id, id);
+ string_copy_rev(ref->id, id);
return OK;
}