Skip to content

Commit

Permalink
Move code to goto_id() so that :<sha1 of a tag> works as well
Browse files Browse the repository at this point in the history
  • Loading branch information
koutcher committed Jan 23, 2022
1 parent 87e2862 commit 9b0a664
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,8 @@ goto_id(struct view *view, const char *expr, bool from_start, bool save_search)
report("Jumping to ID is not supported by the %s view", view->name);
return;
} else {
char *rev = argv_format_arg(view->env, expr);
char dest[SIZEOF_STR];
char *rev = snprintf(dest, SIZEOF_STR, "%s^{}", expr) ? argv_format_arg(view->env, dest) : NULL;
const char *rev_parse_argv[] = {
"git", "rev-parse", "--revs-only", rev, NULL
};
Expand Down

0 comments on commit 9b0a664

Please sign in to comment.