Skip to content

glide screws up .git file when using a submodule #828

@RaduBerinde

Description

@RaduBerinde

I ran into an issue that was very frustrating to track down.

The vendor directory is a submodule, so it has a .git file (not a directory):

# cat vendor/.git 
gitdir: ../.git/modules/vendor

After running glide up, this is replaced with an empty directory with no execute permissions:

# ls -la vendor/.git
ls: cannot access 'vendor/.git/..': Permission denied
ls: cannot access 'vendor/.git/.': Permission denied
total 0
d????????? ? ? ? ?            ? .
d????????? ? ? ? ?            ? ..

This bogus directory causes git status to fork-bomb my machine (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=750687). The icing on the cake is that I have my shell run git status automatically to show some info in the prompt :)

I looked at the code a bit and I believe the culprit is this call:

err = fixcle(ivg, vpg, terr)

Indeed, on my system /tmp is a separate filesystem, so the rename wouldn't work. This code should be fixed so it copies the file (if it's just a file).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions