Skip to content

Commit

Permalink
Don't pull LFS objects for yubico-binaries repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ajhall committed Mar 20, 2024
1 parent 84e8da9 commit 949e35e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions content/.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
{
"url": "[email protected]:Yubico/yubico-binaries.git",
"preserve_mtimes": true,
"skip_lfs": true,
"files": [
["%(name)s/releases/*", "Releases/"],
["%(name)s/mans/*.adoc", "Manuals/"],
Expand Down
1 change: 1 addition & 0 deletions content/Archive_Old_Dev_Docs/YubiHSM2/.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{
"url": "[email protected]:Yubico/yubico-binaries.git",
"preserve_mtimes": true,
"skip_lfs": true,
"files": [
["yubihsm2/releases/*", "Releases/"]
]
Expand Down
1 change: 1 addition & 0 deletions content/YubiHSM2/.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{
"url": "[email protected]:Yubico/yubico-binaries.git",
"preserve_mtimes": true,
"skip_lfs": true,
"files": [
["yubihsm2/releases/*", "Releases/"]
]
Expand Down
3 changes: 2 additions & 1 deletion content/projects/windows-apis/.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"git": [
{
"url": "[email protected]:Yubico/yubico-binaries.git",
"files": [["windows-apis/releases/*", "Releases/"]]
"skip_lfs": true,
"files": [["windows-apis/releases/*", "Releases/"]]
}
]
}
7 changes: 5 additions & 2 deletions devyco/modules/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
url: Git repository URL (required).
files: List of filepatterns to copy from the repository (default: all)
preserve_mtimes: If true, set mtimes based on commit times (default: false)
skip_lfs: If true, fetch the repo without pulling Git LFS objects
The "git" entry can also be a list of objects containing the settings above if
multiple repositories should be clones.
Expand Down Expand Up @@ -94,8 +95,10 @@ def _clone(self, conf):
cwd=repo_dir, stderr=sys.stdout.fileno())
else:
print "clone:", url
subprocess.check_call(['git', 'clone', url, repo_dir],
stderr=sys.stdout.fileno())
clone_cmd = ['git', 'clone', url, repo_dir]
if conf.get('skip_lfs'):
clone_cmd += ['-c', 'filter.lfs.process=git-lfs filter-process --skip']
subprocess.check_call(clone_cmd, stderr=sys.stdout.fileno())
subprocess.check_call(['git', 'reset', 'origin/%s' % branch, '--hard'],
cwd=repo_dir, stderr=sys.stdout.fileno())

Expand Down

0 comments on commit 949e35e

Please sign in to comment.