File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 25
25
current=$( git rev-parse --abbrev-ref HEAD)
26
26
27
27
# Checkout most recent gh-pages
28
- git fetch origin
29
- git checkout -f gh-pages
30
- git reset --hard origin/gh-pages
28
+ git fetch --force $repository gh-pages:gh-pages
29
+ git checkout gh-pages
30
+ git clean -fdx
31
31
32
32
# Make an array of directories to not delete, from the list of remote branches
33
- branches=$( git branch -r --list origin/* )
34
-
35
- # Strip off the remote name prefix
36
- branches=" ${branches[@]// origin\/ / } "
33
+ branches=$( git ls-remote --refs --quiet $repository | awk ' {print $2}' | sed -e ' s/refs\/heads\///' )
37
34
38
35
# Add parent directories of branches to the exclusion list (e.g. greenkeeper/)
39
36
for branch in $branches ; do
@@ -42,7 +39,7 @@ for branch in $branches; do
42
39
fi
43
40
done
44
41
45
- # Dedupe all the greenkeepers
42
+ # Dedupe all the greenkeepers (or other duplicate parent directories)
46
43
branches=$( echo " ${branches[@]} " | tr ' ' ' \n' | sort -u | tr ' \n' ' ' )
47
44
48
45
# Remove all directories that don't have corresponding branches
You can’t perform that action at this time.
0 commit comments