From 7482b202de0dfeae309fe2e990276b7c43dda3cb Mon Sep 17 00:00:00 2001
From: Zeno Albisser <zeno.albisser@digia.com>
Date: Mon, 13 Jan 2014 13:10:50 +0100
Subject: [PATCH] init-repository.py should only be used when cloning with git.

Change-Id: I8df487f3abcdaae9303c8353b6a9f26c88bc6840
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
---
 init-repository.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/init-repository.py b/init-repository.py
index 3f33b77cd..c39e60fc4 100755
--- a/init-repository.py
+++ b/init-repository.py
@@ -50,6 +50,22 @@ import argparse
 
 qtwebengine_root = os.path.abspath(os.path.join(os.path.dirname(__file__)))
 
+def sanityCheckRepo():
+    os.chdir(qtwebengine_root)
+    if not '.git' in os.listdir('.'):
+        print ''
+        print 'This source tree cannot be initialized with init-repository.py.'
+        print ''
+        print 'If you downloaded an archive containing these sources,'
+        print 'you do not need to run the init-repository.py script.'
+        print ''
+        print 'If you want to use git for working with qtwebengine,'
+        print 'use git to clone: git@gitorious.org:qt-labs/qtwebengine.git'
+        print ''
+        sys.exit(0)
+
+sanityCheckRepo()
+
 sys.path.append(os.path.join(qtwebengine_root, 'tools', 'scripts'))
 import git_submodule as GitSubmodule
 import version_resolver as resolver
-- 
GitLab