summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8f2a69d)
raw | patch | inline | side by side (parent: 8f2a69d)
author | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 6 Oct 2008 11:11:21 +0000 (13:11 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 6 Oct 2008 11:18:17 +0000 (13:18 +0200) |
tig.c | patch | blob | history |
index e22d33de5205e10cbb4bc41b05a4e7a3f4c0ef20..4f21c3d86edae75ffefa0bebc703fa20fda2e967 100644 (file)
--- a/tig.c
+++ b/tig.c
* Main view backend
*/
+static int load_refs(void);
+
static bool
main_draw(struct view *view, struct line *line, unsigned int lineno)
{
open_view(view, REQ_VIEW_DIFF, flags);
break;
case REQ_REFRESH:
+ load_refs();
string_copy(opt_cmd, view->cmd);
open_view(view, REQ_VIEW_MAIN, OPEN_RELOAD);
break;
const char *cmd_env = getenv("TIG_LS_REMOTE");
const char *cmd = cmd_env && *cmd_env ? cmd_env : TIG_LS_REMOTE;
+ if (!*opt_git_dir)
+ return OK;
+
+ while (refs_size > 0)
+ free(refs[--refs_size].name);
+ while (id_refs_size > 0)
+ free(id_refs[--id_refs_size]);
+
return read_properties(popen(cmd, "r"), "\t", read_ref);
}
die("Failed to initialize character set conversion");
}
- if (*opt_git_dir && load_refs() == ERR)
+ if (load_refs() == ERR)
die("Failed to load refs.");
for (i = 0; i < ARRAY_SIZE(views) && (view = &views[i]); i++)