phase1: fix gitcheckout with corrupted .git
authorPetr Štetiar <ynezz@true.cz>
Tue, 9 Feb 2021 21:21:15 +0000 (22:21 +0100)
committerPetr Štetiar <ynezz@true.cz>
Tue, 9 Feb 2021 21:21:15 +0000 (22:21 +0100)
commit976b2fd5170db09a34985d8d479a6d45dc214787
tree322e78c16910bfc7190c17de233c46612f7967b7
parent4ecef3f5c7cafdc1ce55a3cc40f74eaf702a2de2
phase1: fix gitcheckout with corrupted .git

When the container running `git clone` is killed it will leave the .git
directory in unusable state which then leads in the following errors:

 if [ -d .git ]; then git checkout -f master; git branch --set-upstream-to origin/master; else exit 0; fi
 error: pathspec 'master' did not match any file(s) known to git.
 fatal: branch 'master' does not exist

Fix it by removing .git completely if this happens, otherwise it might
simply leave shared build directory in the unusable state.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
phase1/master.cfg