[tor-commits] [tor/maint-0.2.9] Test for .git as readable instead of a dir to support worktrees

nickm at torproject.org nickm at torproject.org
Mon Dec 5 13:22:17 UTC 2016


commit cf2f36b8b422aa4cf11282bc14421b6dbfa54beb
Author: J. Ryan Stinnett <jryans at gmail.com>
Date:   Sun Dec 4 21:16:59 2016 -0600

    Test for .git as readable instead of a dir to support worktrees
    
    Fixes #20492.
---
 changes/20492     | 4 ++++
 src/or/include.am | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/changes/20492 b/changes/20492
new file mode 100644
index 0000000..fdcd4d0
--- /dev/null
+++ b/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.
diff --git a/src/or/include.am b/src/or/include.am
index b4554aa..ae493b7 100644
--- a/src/or/include.am
+++ b/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; \



More information about the tor-commits mailing list