File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,18 @@ cd $WORKING_DIRECTORY
46
46
git config --global advice.detachedhead false
47
47
git config --global credential.helper " /bin/sh -c 'echo username=$USERNAME ; echo password=$PASSWORD '"
48
48
49
+ if [ -n " $SPARE_CHECKOUT " ]; then
50
+ echo " spare checkout"
51
+ git init $CLONE_DIR
52
+ chmod -R 774 $CLONE_DIR
53
+ cd $CLONE_DIR
54
+ git remote add origin $REPO
55
+ git config core.sparsecheckout true
56
+ echo " $SOURCE /*" >> .git/info/sparse-checkout
57
+ git pull --depth=1 origin $REVISION
58
+ exit 0
59
+ fi
60
+
49
61
# Check if the cloned dir already exists from previous builds
50
62
if [ -d " $CLONE_DIR " ]; then
51
63
@@ -96,16 +108,6 @@ if [ -d "$CLONE_DIR" ]; then
96
108
fi
97
109
else
98
110
99
- if [ -n " $SPARE_CHECKOUT " ]; then
100
- echo " spare checkout"
101
- git init $CLONE_DIR
102
- chmod -R 774 $CLONE_DIR
103
- cd $CLONE_DIR
104
- git remote add origin $REPO
105
- git config core.sparsecheckout true
106
- echo " $SOURCE /*" >> .git/info/sparse-checkout
107
- git pull --depth=1 origin $REVISION
108
- else
109
111
# Clone a fresh copy
110
112
echo " cloning $REPO "
111
113
git_retry git clone $REPO $CLONE_DIR
115
117
git checkout $REVISION
116
118
fi
117
119
118
- fi
119
-
120
120
fi
You can’t perform that action at this time.
0 commit comments