Skip to content

fix: inserting snippets not working for newly created snippets

Tomas Vik requested to merge 397-fix-inserting-snippets into main

GitLab 14.0 started using main as the main branch for every repository and since snippets are backed by repositories, all new snippets have their blobs on main branch instead of master. That means we have to find out which branch to use.

Luckily, each blob contains a rawPath attribute which contains the branch.

Once we don't have to support GitLab 14.0 and older, we can start fetching the snippet content directly from GraphQL (gitlab#260316 (closed) implemented in 14.1). Till then, we need this workaround.

Related to #397 (closed)

Edited by Tomas Vik

Merge request reports