summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c2c2839)
raw | patch | inline | side by side (parent: c2c2839)
author | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 9 Jun 2010 03:10:08 +0000 (23:10 -0400) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 9 Jun 2010 03:11:29 +0000 (23:11 -0400) |
NEWS | patch | blob | history | |
tig.c | patch | blob | history |
index 190e5dcee78ae3ede429e24085e75c37f9baddac..f46ee701454f992162952c10831d3db9ece1ce64 100644 (file)
--- a/NEWS
+++ b/NEWS
Improvements:
+ - Plug several memory leaks.
- Command line arguments are split into diff, revision, and file
arguments and made available as %(diff-args), %(rev-args), and
%(file-args). Diff view will limit diffs using %(file-args).
index c963977bbdcdb71338534f27440563107ac9d8b1..810e5e785135ddbfb84b77c822ebb5ab3e7d6296 100644 (file)
--- a/tig.c
+++ b/tig.c
blame_open(struct view *view)
{
char path[SIZEOF_STR];
+ size_t i;
if (!view->prev && *opt_prefix) {
string_copy(path, opt_file);
return FALSE;
}
+ /* First pass: remove multiple references to the same commit. */
+ for (i = 0; i < view->lines; i++) {
+ struct blame *blame = view->line[i].data;
+
+ if (blame->commit && blame->commit->id[0])
+ blame->commit->id[0] = 0;
+ else
+ blame->commit = NULL;
+ }
+
+ /* Second pass: free existing references. */
+ for (i = 0; i < view->lines; i++) {
+ struct blame *blame = view->line[i].data;
+
+ if (blame->commit)
+ free(blame->commit);
+ }
+
setup_update(view, opt_file);
string_format(view->ref, "%s ...", opt_file);