summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 085b572)
raw | patch | inline | side by side (parent: 085b572)
author | Jonas Fonseca <fonseca@diku.dk> | |
Sun, 8 Feb 2009 19:36:28 +0000 (20:36 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Sun, 8 Feb 2009 19:36:28 +0000 (20:36 +0100) |
tig.c | patch | blob | history |
index 13c167d3c49f772d12dcd680eda2658c8d5181bb..62645334d9e6dcdc86ed108583e4e1ce4269e473 100644 (file)
--- a/tig.c
+++ b/tig.c
}
static bool
-check_blame_commit(struct blame *blame)
+check_blame_commit(struct blame *blame, bool check_null_id)
{
if (!blame->commit)
report("Commit data not loaded yet");
- else if (!strcmp(blame->commit->id, NULL_ID))
+ else if (check_null_id && !strcmp(blame->commit->id, NULL_ID))
report("No commit exist for the selected line");
else
return TRUE;
switch (request) {
case REQ_VIEW_BLAME:
- if (check_blame_commit(blame)) {
+ if (check_blame_commit(blame, TRUE)) {
string_copy(opt_ref, blame->commit->id);
string_copy(opt_file, blame->commit->filename);
if (blame->lineno)
break;
case REQ_PARENT:
- if (check_blame_commit(blame) &&
+ if (check_blame_commit(blame, TRUE) &&
select_commit_parent(blame->commit->id, opt_ref,
blame->commit->filename)) {
string_copy(opt_file, blame->commit->filename);
break;
case REQ_ENTER:
- if (!blame->commit) {
- report("No commit loaded yet");
+ if (!check_blame_commit(blame, FALSE))
break;
- }
if (view_is_displayed(VIEW(REQ_VIEW_DIFF)) &&
!strcmp(blame->commit->id, VIEW(REQ_VIEW_DIFF)->ref))