ソースを参照

support/download/git: add missing "git lfs install" invocation for LFS support

The original patch for commit cff428fe31 ("download/git: support Git
LFS") included a call to "git lfs install" but this was a problem as it
could modify ~/.gitconfig outside the dl/ tree.  When this was
updated it was thought that the modification to gitconfig was
unnecessary because the LFS fetch and checkout steps are performed
manually.

Unfortunately, this is not correct and the LFS checkout fails with:

	Cannot checkout LFS objects, Git LFS is not installed.

Add the call to "git lfs install", with the --local option so that only
the repository's .git/config is modified and not the user's global
~/.gitconfig.

This is also required for submodules as the parent repository's config
is not inherited.

Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Vincent Fazio <vfazio@xes-inc.com>
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
John Keeping 3 年 前
コミット
338b2e58d4
1 ファイル変更2 行追加0 行削除
  1. 2 0
      support/download/git

+ 2 - 0
support/download/git

@@ -209,10 +209,12 @@ fi
 
 
 # If there are large files then fetch them.
 # If there are large files then fetch them.
 if [ ${large_file} -eq 1 ]; then
 if [ ${large_file} -eq 1 ]; then
+    _git lfs install --local
     _git lfs fetch
     _git lfs fetch
     _git lfs checkout
     _git lfs checkout
     # If there are also submodules, recurse into them,
     # If there are also submodules, recurse into them,
     if [ ${recurse} -eq 1 ]; then
     if [ ${recurse} -eq 1 ]; then
+        _git submodule foreach --recursive ${GIT} lfs install --local
         _git submodule foreach --recursive ${GIT} lfs fetch
         _git submodule foreach --recursive ${GIT} lfs fetch
         _git submodule foreach --recursive ${GIT} lfs checkout
         _git submodule foreach --recursive ${GIT} lfs checkout
     fi
     fi