Skip to content

Commit 9c16470

Browse files
authored
Merge pull request #418 from rmg/optimize-check
Optimize check
2 parents a7587c9 + c392e87 commit 9c16470

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

assets/check

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,20 @@ export GIT_LFS_SKIP_SMUDGE=1
5858

5959
if [ -d $destination ]; then
6060
cd $destination
61-
git fetch $tagflag -f
62-
git reset --hard FETCH_HEAD
61+
git fetch origin $tagflag $branch -f
62+
git reset --soft FETCH_HEAD
6363
else
6464
branchflag=""
6565
if [ -n "$branch" ]; then
6666
branchflag="--branch $branch"
6767
fi
6868

69-
git clone --single-branch $uri $branchflag $destination $tagflag
69+
git clone --bare --filter=blob:none --single-branch $uri $branchflag $destination $tagflag
7070
cd $destination
71+
# bare clones don't configure the refspec
72+
if [ -n "$branch" ]; then
73+
git remote set-branches --add origin $branch
74+
fi
7175
fi
7276

7377
if [ -n "$ref" ] && git cat-file -e "$ref"; then

0 commit comments

Comments
 (0)