when fixing configs, bail out if the repo is somehow invalid

This commit is contained in:
Rudolf Polzer 2011-07-27 19:50:16 +02:00
parent 2bc85d3c03
commit 424371fc87

4
all
View File

@ -380,6 +380,10 @@ fix_upstream_rebase_mergefail()
fix_git_config()
{
if ! [ -d ".git" ]; then
$ECHO "Not a git repository. Bailing out to not cause damage."
exit 1
fi
verbose git config remote.origin.url "$1"
if [ -n "$2" ]; then
verbose git config remote.origin.pushurl "$2"