Skip to content

Commit c20b8e1

Browse files
committed
[release-branch.go1.5] build: Fix bootstrap.bash for official source tarballs
At the moment, bootstrap.bash assumes it is called from a git working copy. Hence, it fails to complete when running in an unpacked official source tarball where .git and .gitignore do not exist. This fix adds a test for existence for .git and a -f switch for the removal of .gitignore. Fixes #12223 Change-Id: I7f305b83b38d5115504932bd38dadb7bdeb5d487 Reviewed-on: https://go-review.googlesource.com/13770 Reviewed-by: Dave Cheney <[email protected]> Reviewed-by: Andrew Gerrand <[email protected]> Reviewed-on: https://go-review.googlesource.com/14281
1 parent 5aa3ba8 commit c20b8e1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/bootstrap.bash

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ cp -R "$src" "$targ"
3535
cd "$targ"
3636
echo
3737
echo "#### Cleaning $targ"
38-
rm .gitignore
39-
git clean -f -d
38+
rm -f .gitignore
39+
if [ -e .git ]; then
40+
git clean -f -d
41+
fi
4042
echo
4143
echo "#### Building $targ"
4244
echo

0 commit comments

Comments
 (0)