dokku / plugn

Hook system that lets users extend your application with plugins
MIT License
82 stars 22 forks source link

plugin using 'main' default branch ends up in error during plugn update #71

Closed Cactusbone closed 5 months ago

Cactusbone commented 2 years ago

See https://github.com/dokku/plugn/blob/3cb228fbfea4f76473b8b9bc7bd29f701f859a32/bashenv/plugn.bash#L53

git checkout master &> /dev/null does not work when no 'master' branch exists. (newly created github projects uses main as default)

Seen here: https://github.com/dokku/dokku/discussions/5041

However to work around it, I changed my default branch to 'master'.

Using something like git checkout refs/remotes/origin/HEAD should work

josegonzalez commented 2 years ago

Good catch! Mind making an MR for this?

mattmess1221 commented 7 months ago

I think I can get this fixed.

Is there a reason a lot of the the git commands end in &>/dev/null instead of >/dev/null? Unless it's some obscure syntax, I don't see much of a reason to run all the commands in the background. It might even be detrimental when you checkout a new commit before the pull finishes. Oh, I see. It redirects stdout and stderr.