]> git.cameronkatri.com Git - cgit.git/commitdiff
ui-plain: print symlink content
authorJohn Keeping <john@keeping.me.uk>
Mon, 6 Mar 2017 23:27:23 +0000 (23:27 +0000)
committerJason A. Donenfeld <Jason@zx2c4.com>
Thu, 10 Aug 2017 14:05:07 +0000 (16:05 +0200)
We currently ignore symlinks in ui-plain, leading to a 404.  In ui-tree
we print the content of the blob (that is, the path to the target of the
link), so it makes sense to do the same here.

Signed-off-by: John Keeping <john@keeping.me.uk>
ui-plain.c

index e45d553ecc97db424c36011c052d575a5cf637a4..cfdbf730db0772ec2adf99d775434577d371199d 100644 (file)
@@ -135,7 +135,7 @@ static int walk_tree(const unsigned char *sha1, struct strbuf *base,
        struct walk_tree_context *walk_tree_ctx = cbdata;
 
        if (base->len == walk_tree_ctx->match_baselen) {
-               if (S_ISREG(mode)) {
+               if (S_ISREG(mode) || S_ISLNK(mode)) {
                        if (print_object(sha1, pathname))
                                walk_tree_ctx->match = 1;
                } else if (S_ISDIR(mode)) {