add_pager_refs(struct view *view, struct line *line)
{
char buf[1024];
- char *data = line->data;
+ char *commit_id = line->data + STRING_SIZE("commit ");
struct ref **refs;
int bufpos = 0, refpos = 0;
const char *sep = "Refs: ";
assert(line->type == LINE_COMMIT);
- refs = get_refs(data + STRING_SIZE("commit "));
+ refs = get_refs(commit_id);
if (!refs)
return;
buf[pos++] = 0;
if (!string_format(opt_cmd, "git %s", buf))
return ERR;
- opt_request = REQ_VIEW_PAGER;
+ if (strncmp(buf, "show", 4) && isspace(buf[4]))
+ opt_request = REQ_VIEW_DIFF;
+ else
+ opt_request = REQ_VIEW_PAGER;
return OK;
}