diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Show an absolute link target as text
A symlink to /etc/passwd was resolved against the tree and linked to etc/passwd inside it, a different file or none at all.
Diffstat (limited to 'source/ui-tree.c')
-rw-r--r--source/ui-tree.c7
1 file changed, 4 insertions, 3 deletions
diff --git a/source/ui-tree.c b/source/ui-tree.c
index c030134..51ab9ff 100644
--- a/source/ui-tree.c
+++ b/source/ui-tree.c
@@ -336,9 +336,10 @@ static void print_ls_row(const struct object_id *oid, const char *pathname,
} else {
strbuf_addbuf(&linkpath, &fullpath);
strbuf_addf(&linkpath, "/../%s", buf);
- // A target climbing above the tree root has nothing to
- // link to.
- if (strbuf_normalize_path(&linkpath))
+ // A target climbing above the tree root, or one given
+ // from the root of the filesystem, has nothing in the
+ // tree to link to.
+ if (buf[0] == '/' || strbuf_normalize_path(&linkpath))
html_txt(buf);
else
cgit_tree_link(buf, NULL, class.buf, ctx.qry.head, walk->rev,