diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2013-03-20 20:21:25 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2013-03-20 20:21:25 +0100 |
commit | 0255821e22678d4c58c809efe17bf2798835d5b9 (patch) | |
tree | d4679ff23796406648cf83ff0b98940ba844c5e1 /ui-tree.c | |
parent | 6d8a789d61f3a682bc040f1f7f44050b1f723546 (diff) | |
parent | 59fe348deaa270434f05afc56ca8d13618af9ca9 (diff) | |
download | cgit-0255821e22678d4c58c809efe17bf2798835d5b9.tar.gz cgit-0255821e22678d4c58c809efe17bf2798835d5b9.tar.bz2 |
Merge branch 'wip'
Diffstat (limited to 'ui-tree.c')
-rw-r--r-- | ui-tree.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -271,7 +271,6 @@ void cgit_print_tree(const char *rev, char *path) if (!rev) rev = ctx.qry.head; - walk_tree_ctx.curr_rev = xstrdup(rev); if (get_sha1(rev, sha1)) { cgit_print_error(fmt("Invalid revision name: %s", rev)); return; @@ -282,12 +281,17 @@ void cgit_print_tree(const char *rev, char *path) return; } + walk_tree_ctx.curr_rev = xstrdup(rev); + if (path == NULL) { ls_tree(commit->tree->object.sha1, NULL, &walk_tree_ctx); - return; + goto cleanup; } read_tree_recursive(commit->tree, "", 0, 0, &paths, walk_tree, &walk_tree_ctx); if (walk_tree_ctx.state == 1) ls_tail(); + +cleanup: + free(walk_tree_ctx.curr_rev); } |