From d7604dab4dcd4c826828cb1abbed6eabdbcfa790 Mon Sep 17 00:00:00 2001 From: Eric Sunshine Date: Wed, 31 Dec 2014 04:50:06 -0500 Subject: write_tree: suppress double-slash in blob HTML filename When emitting a blob in the root tree of a commit, write_tree() composes the blob's HTML filename with an extra slash before the "f=", like this: output/r/repo/b/master/t//f=README.txt.html Although the double-slash is not harmful on Unix, it is unsightly, and may be problematic for other platforms or filesystems which interpret double-slash specially or disallow it. Therefore, suppress the extra slash for blobs in the root tree. Signed-off-by: Eric Sunshine Signed-off-by: Alberto Bertogli --- git-arr | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'git-arr') diff --git a/git-arr b/git-arr index bd38324..6982b00 100755 --- a/git-arr +++ b/git-arr @@ -347,8 +347,9 @@ def generate(output, skip_index = False): dirname = git.smstr(os.path.dirname(oname.raw)) fname = git.smstr(os.path.basename(oname.raw)) write_to( - 'r/%s/b/%s/t/%s/f=%s.html' % - (str(r.name), str(bn), dirname.raw, fname.raw), + 'r/%s/b/%s/t/%s%sf=%s.html' % + (str(r.name), str(bn), + dirname.raw, '/' if dirname.raw else '', fname.raw), blob, (r, bn, fname.url, dirname.url), mtime) else: write_to('r/%s/b/%s/t/%s/index.html' % -- cgit v1.2.3