From 5db54795ae05d1a2608e08c80b1c8a5cb3eb7b83 Mon Sep 17 00:00:00 2001 From: Andrej Shadura <andrew.shadura@collabora.co.uk> Date: Wed, 25 May 2022 11:12:18 +0200 Subject: [PATCH] Preserve attributes for files managed by Git LFS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Git attributes for Git LFS are rarely without a reason in the upstream tarballs, so assume they make sense if they’re in .gitattributes, and copy them over into .git/info/attributes after an override to make sure they still work and files managed by Git LFS can still be checked out. Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk> --- ci-package-builder.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ci-package-builder.yml b/ci-package-builder.yml index 9f273ac..365e50c 100644 --- a/ci-package-builder.yml +++ b/ci-package-builder.yml @@ -107,6 +107,11 @@ default: - mkdir -p .git/info - echo '* -text -eol -crlf -ident -filter -working-tree-encoding -export-subst' > .git/info/attributes - echo 'debian/changelog merge=dpkg-mergechangelogs' >> .git/info/attributes + - | + if [ -f .gitattributes ] + then + sed -n "/ filter=lfs/p" .gitattributes >> .git/info/attributes + fi - command -v git && git reset --hard - EXTRA_REPO_VERSION=${EXTRA_REPO_VERSION:-${CI_DEFAULT_BRANCH##$OSNAME/}} - | -- GitLab