Skip to content

symlinks inside folders are not followed #89

@posva

Description

@posva

Hi, I noticed that if I create symlinks inside of a folder, they aren't followed. They do work if the target path is a symlink.

Here is a simplified reproduction

set -e

# create a temp folder to test
FTEMP=$(mktemp -d)

echo "Creating test repository in $FTEMP"
mkdir -p "$FTEMP"
cd "$FTEMP"

mkdir -p cache/pkg-1/docs
echo "The answer is 'osgrep is great!'" >cache/pkg-1/docs/file1.md

mkdir docs
ln -s cache/pkg-1 docs/pkg-1

which tree && tree "$FTEMP"

# osgrep index --path docs
osgrep search "answer" docs

echo
echo "=== Now the version that works ==="
echo

FTEMP=$(mktemp -d)

echo "Creating test repository in $FTEMP"
mkdir -p "$FTEMP"
cd "$FTEMP"

mkdir -p cache/docs
echo "The answer is 'osgrep is great!'" >cache/docs/file1.md

ln -s cache/docs docs

which tree && tree "$FTEMP"

# osgrep index --path docs
osgrep search "answer" docs

You will notice that the first scenario doesn't work but the second does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions