packaging: virtiofsd: Allow building a specific commit

#10714 added support for building a specific commit,
but due to the clone only having `--depth=1`, we can only
reset to a commit if it's the latest on the `main` branch,
otherwise we will get:
```
+ git clone --depth 1 --branch main https://gitlab.com/virtio-fs/virtiofsd virtiofsd
Cloning into 'virtiofsd'...
warning: redirecting to https://gitlab.com/virtio-fs/virtiofsd.git/
+ pushd virtiofsd
+ git reset --hard cecc61bca981ab42aae6ec490dfd59965e79025e
...
fatal: Could not parse object 'cecc61bca981ab42aae6ec490dfd59965e79025e'.
```

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
This commit is contained in:
stevenhorsman 2025-01-31 11:24:23 +00:00
parent 0215d958da
commit 1cf1a332a5

View File

@ -50,10 +50,10 @@ pull_virtiofsd_released_binary() {
}
build_virtiofsd_from_source() {
echo "build viriofsd from source"
echo "build virtiofsd from source"
. /etc/profile.d/rust.sh
git clone --depth 1 --branch main ${virtiofsd_repo} virtiofsd
git clone --branch main ${virtiofsd_repo} virtiofsd
pushd virtiofsd
git reset --hard ${virtiofsd_version}