summarylogtreecommitdiffstats
path: root/SConstruct.patch
blob: abbfef17ac37dccfd716c4e156c444f251336d19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--- SConstruct.orig	2010-06-13 19:27:24.000000000 +0200
+++ SConstruct	2011-07-26 20:26:12.253266624 +0200
@@ -76,11 +76,14 @@
 	try:
 		gitlog = subprocess.Popen(["git", "show", "--abbrev-commit"], stdout=subprocess.PIPE)
 	except OSError:
-		print("Not a Git repository. Can't fetch commit id.")
-		commit_string = ""
+		commit_string = "" 
 	else:
-		commit_string = gitlog.communicate()[0].split("\n")[0].split(" ")[1]
-		print("Current Git commit id is: "+commit_string)
+		if gitlog.poll() != "0":
+			print("Not a Git repository. Can't fetch commit id.")
+			commit_string = "" 
+		else:
+			commit_string = gitlog.communicate()[0].split("\n")[0].split(" ")[1]
+			print("Current Git commit id is: "+commit_string)
 	return commit_string
 
 def write_git_rev(commit_id):