Browse Source

Test for .git as readable instead of a dir to support worktrees

Fixes #20492.
J. Ryan Stinnett 7 years ago
parent
commit
cf2f36b8b4
2 changed files with 5 additions and 1 deletions
  1. 4 0
      changes/20492
  2. 1 1
      src/or/include.am

+ 4 - 0
changes/20492

@@ -0,0 +1,4 @@
+  o Minor bugfix (build):
+    - The current Git revision when building from a local repository is now
+      detected correctly when using git worktrees.  Fixes bug 20492; bugfix on
+      0.2.3.9-alpha.

+ 1 - 1
src/or/include.am

@@ -198,7 +198,7 @@ noinst_HEADERS+= $(ORHEADERS) micro-revision.i
 
 micro-revision.i: FORCE
 	$(AM_V_at)rm -f micro-revision.tmp; \
-	if test -d "$(top_srcdir)/.git" && \
+	if test -r "$(top_srcdir)/.git" && \
 			test -x "`which git 2>&1;true`"; then \
 		HASH="`cd "$(top_srcdir)" && git rev-parse --short=16 HEAD`"; \
 		echo \"$$HASH\" > micro-revision.tmp; \