File tree Expand file tree Collapse file tree 1 file changed +18
-12
lines changed Expand file tree Collapse file tree 1 file changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,24 @@ 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
+ if [ -d " $CLONE_DIR " ]; then
52
+ echo " folder exists - no need to init"
53
+ cd $CLONE_DIR
54
+ else
55
+ git init $CLONE_DIR
56
+ chmod -R 774 $CLONE_DIR
57
+ cd $CLONE_DIR
58
+ git remote add origin $REPO
59
+ git config core.sparsecheckout true
60
+ echo " $SOURCE /*" >> .git/info/sparse-checkout
61
+ fi
62
+
63
+ git pull --depth=1 origin $REVISION
64
+ exit 0
65
+ fi
66
+
49
67
# Check if the cloned dir already exists from previous builds
50
68
if [ -d " $CLONE_DIR " ]; then
51
69
@@ -96,16 +114,6 @@ if [ -d "$CLONE_DIR" ]; then
96
114
fi
97
115
else
98
116
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
117
# Clone a fresh copy
110
118
echo " cloning $REPO "
111
119
git_retry git clone $REPO $CLONE_DIR
115
123
git checkout $REVISION
116
124
fi
117
125
118
- fi
119
-
120
126
fi
You can’t perform that action at this time.
0 commit comments