Source-branch not working?

I have a part in my snapcraft.yaml which goes like this

    plugin: make
    source: user_mstp
    source-branch: feature-branch1
    source-type: git
    source-subdir: mstp_test
    artifacts: [fuse_mstp]
    make-parameters: [FUSE_LIB_INSTALL_DIR=$SNAPCRAFT_PART_INSTALL/../../libfuse/install, clean, fuse_mstp ]
      - libfuse

the repo is already cloned and is at master branch. I was expecting snapcraft to switch the branch as per source-branch but that does not seems to be the case and snap is built with the master branch itself. Is there something I am doing wrong here ?

As it happens, I have project around that I played with to see if I could duplicate. The problem is clearer with the snap/multipass version of snapcraft. I got an error like this:

Failed to pull source, command 'git clone --recursive --branch fix-head-badguy-scoring . /root/parts/jgalaxian/src' exited with code 128.

In my case, source was set to . and my source-branch was fix-head-badguy-scoring.

I think when source-type is git, source must be a clonable git repo url. Then, the source branch works, or at least it does for me.

I guess in the apt version of snapcraft (presumably what you’re using), the error gets ignored or buried.