diff options
author | Malfurious <m@lfurio.us> | 2024-03-11 09:49:23 -0400 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2024-03-11 09:49:23 -0400 |
commit | 1225cf17d153e3bee7ef58da47ef38b2e32b8b75 (patch) | |
tree | 56ebaa03d5762dd4846f776ef46987758b87b9dc | |
parent | d489b4438ded736c61a7dadeb87a6bd90ea53b50 (diff) | |
download | srcnode-1225cf17d153e3bee7ef58da47ef38b2e32b8b75.tar.gz srcnode-1225cf17d153e3bee7ef58da47ef38b2e32b8b75.zip |
gitolite: Fix bug in post git trigger branch detection
The previous version fails to handle nested branch names containing
slashes. For example, if pushing a single new branch named
`feat/example`, the script would set HEAD to `feat` and remain dangling.
Signed-off-by: Malfurious <m@lfurio.us>
-rwxr-xr-x | gitolite/dotfiles/local/triggers/push | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gitolite/dotfiles/local/triggers/push b/gitolite/dotfiles/local/triggers/push index 2c5e060..4a23583 100755 --- a/gitolite/dotfiles/local/triggers/push +++ b/gitolite/dotfiles/local/triggers/push @@ -6,7 +6,7 @@ cd "$GL_REPO_BASE/$2.git" head=$(git symbolic-ref HEAD) if ! [ -f "$head" ]; then - set -- refs/heads/* + set -- $(find refs/heads -type f) if [ $# -eq 1 ] && git symbolic-ref HEAD "$1" >/dev/null 2>&1; then echo "NOTICE: Default branch set to $1" >&2 else |