diff options
author | Eric Sunshine <sunshine@sunshineco.com> | 2014-12-31 10:50:06 +0100 |
---|---|---|
committer | Alberto Bertogli <albertito@blitiri.com.ar> | 2015-01-11 22:18:14 +0100 |
commit | d7604dab4dcd4c826828cb1abbed6eabdbcfa790 (patch) | |
tree | c6509d488dd64c9536203ff2d243214bfe179d58 /git-arr | |
parent | aaf2968538121f9443f1aea2156814fede5a5648 (diff) | |
download | git-arr-fork-d7604dab4dcd4c826828cb1abbed6eabdbcfa790.zip |
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 <sunshine@sunshineco.com>
Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
Diffstat (limited to 'git-arr')
-rwxr-xr-x | git-arr | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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' % |