From e6099cf2729fc446f7cba2dab5da2d6b0646b567 Mon Sep 17 00:00:00 2001 From: Eric Sunshine Date: Wed, 14 Jan 2015 02:46:32 -0500 Subject: tree: pass branch name to view explicitly Passing the branch name into the view indirectly via Repo.new_in_branch() increases cognitive burden, thus outweighing whatever minor convenience (if any) is gained by doing so. The code is easier to reason about when the branch name is passed to the view directly. Signed-off-by: Eric Sunshine Signed-off-by: Alberto Bertogli --- git-arr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'git-arr') diff --git a/git-arr b/git-arr index ae509ea..ce8ef30 100755 --- a/git-arr +++ b/git-arr @@ -256,8 +256,8 @@ def tree(repo, bname, dirname = ''): dirname = git.smstr.from_url(dirname) - r = repo.new_in_branch(bname) - return dict(repo = r, tree = r.tree(), dirname = dirname) + return dict(repo = repo, branch = bname, tree = repo.tree(bname), + dirname = dirname) @bottle.route('/r//b//') @bottle.route('/r//b//.html') -- cgit v1.2.3