1 /* Copyright (c) 2006-2014 Jonas Fonseca <jonas.fonseca@gmail.com>
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License as
5 * published by the Free Software Foundation; either version 2 of
6 * the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
18 stash_open(struct view
*view
, enum open_flags flags
)
20 static const char *stash_argv
[] = { "git", "stash", "list",
21 encoding_arg
, "--no-color", "--pretty=raw", NULL
};
22 struct main_state
*state
= view
->private;
24 state
->with_graph
= FALSE
;
25 return begin_update(view
, NULL
, stash_argv
, flags
| OPEN_RELOAD
);
29 stash_select(struct view
*view
, struct line
*line
)
31 main_select(view
, line
);
32 string_format(view
->env
->stash
, "stash@{%d}", line
->lineno
- 1);
33 string_copy(view
->ref
, view
->env
->stash
);
36 static struct view_ops stash_ops
= {
39 VIEW_SEND_CHILD_ENTER
| VIEW_REFRESH
,
40 sizeof(struct main_state
),
48 view_column_bit(AUTHOR
) | view_column_bit(COMMIT_TITLE
) |
49 view_column_bit(DATE
) | view_column_bit(ID
) |
50 view_column_bit(LINE_NUMBER
),
56 /* vim: set ts=8 sw=8 noexpandtab: */