LFS: Set lfs.url upon the origin url

Signed-off-by: Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>
This commit is contained in:
Vicente Adolfo Bolea Sanchez 2021-06-24 13:26:40 -04:00
parent f7826d1efd
commit dd2aa335e8
2 changed files with 14 additions and 1 deletions

@ -1,3 +1,3 @@
[lfs]
url = https://gitlab.kitware.com/vtk/vtk-m.git/info/lfs
pushurl = git@gitlab.kitware.com:vtk/vtk-m.git
locksverify = false

@ -31,3 +31,16 @@ true
SetupForDevelopment=1
git config hooks.SetupForDevelopment ${SetupForDevelopment_VERSION}
# Setup VTK-m-specifc LFS config
#
# Disable lfsurl if our origin points to the main repo
if git remote get-url origin | grep -Poq '^(https://|git@)gitlab.kitware.com(/|:)vtk/vtk-m.git$'
then
# Disable this setting which overrides every remote/url lfs setting
git config --local lfs.url ""
# Those settings are only available for newer git-lfs releases
git config --local remote.lfspushdefault gitlab
git config --local remote.lfsdefault origin
fi