Skip to content

Commit

Permalink
Allow git operations when LFS isn't functioning (github#20569)
Browse files Browse the repository at this point in the history
* Allow git operations when LFS isn't functioning

* Update to be easier to read
  • Loading branch information
heiskr authored Jul 28, 2021
1 parent 48f9718 commit bbb5576
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
10 changes: 9 additions & 1 deletion .husky/post-checkout
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#!/bin/sh
[ -n "$CI" ] && exit 0
command -v git-lfs >/dev/null 2>&1 && git lfs post-checkout "$@" || { echo >&2 "\nGitHub Docs requires Git LFS but 'git-lfs' was not found on your path.\nLearn how to install Git LFS at <https://git.io/JBCId>.\n"; }
if command -v git-lfs >/dev/null 2>&1
then
if ! (git lfs post-checkout "$@")
then
printf >&2 "\nGitHub Docs requires Git LFS but using the 'git-lfs' on your path failed.\n"
fi
else
printf >&2 "\nGitHub Docs requires Git LFS but 'git-lfs' was not found on your path.\nLearn how to install Git LFS at <https://git.io/JBCId>.\n"
fi
10 changes: 9 additions & 1 deletion .husky/post-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#!/bin/sh
[ -n "$CI" ] && exit 0
command -v git-lfs >/dev/null 2>&1 && git lfs post-commit "$@" || { echo >&2 "\nGitHub Docs requires Git LFS but 'git-lfs' was not found on your path.\nLearn how to install Git LFS at <https://git.io/JBCId>.\n"; }
if command -v git-lfs >/dev/null 2>&1
then
if ! (git lfs post-commit "$@")
then
printf >&2 "\nGitHub Docs requires Git LFS but using the 'git-lfs' on your path failed.\n"
fi
else
printf >&2 "\nGitHub Docs requires Git LFS but 'git-lfs' was not found on your path.\nLearn how to install Git LFS at <https://git.io/JBCId>.\n"
fi
10 changes: 9 additions & 1 deletion .husky/post-merge
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#!/bin/sh
[ -n "$CI" ] && exit 0
command -v git-lfs >/dev/null 2>&1 && git lfs post-merge "$@" || { echo >&2 "\nGitHub Docs requires Git LFS but 'git-lfs' was not found on your path.\nLearn how to install Git LFS at <https://git.io/JBCId>.\n"; }
if command -v git-lfs >/dev/null 2>&1
then
if ! (git lfs post-merge "$@")
then
printf >&2 "\nGitHub Docs requires Git LFS but using the 'git-lfs' on your path failed.\n"
fi
else
printf >&2 "\nGitHub Docs requires Git LFS but 'git-lfs' was not found on your path.\nLearn how to install Git LFS at <https://git.io/JBCId>.\n"
fi
10 changes: 9 additions & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/sh
[ -n "$CI" ] && exit 0
command -v git-lfs >/dev/null 2>&1 && git lfs pre-push "$@" || { echo >&2 "\nGitHub Docs requires Git LFS but 'git-lfs' was not found on your path.\nLearn how to install Git LFS at <https://git.io/JBCId>.\n"; }
if command -v git-lfs >/dev/null 2>&1
then
if ! (git lfs pre-push "$@")
then
printf >&2 "\nGitHub Docs requires Git LFS but using the 'git-lfs' on your path failed.\n"
fi
else
printf >&2 "\nGitHub Docs requires Git LFS but 'git-lfs' was not found on your path.\nLearn how to install Git LFS at <https://git.io/JBCId>.\n"
fi

. "$(dirname "$0")/_/husky.sh"

Expand Down

0 comments on commit bbb5576

Please sign in to comment.