From db70c581a621814feb881494c890ae8a49da709a Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 6 Dec 2017 21:23:19 -0600 Subject: [PATCH] Correctly determine git SHA if libdivecomputer is a git submodule In the case of a submodule, the .git file is a text file pointing to the correct module in the parent's .git folder. The git rev-parse works correctly in both cases. Signed-off-by: Dirk Hohndel --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 1545bc7..5df0b68 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -97,7 +97,7 @@ libdivecomputer.lo: revision.h FORCE: $(top_srcdir)/revision: FORCE - @if (test -d $(top_srcdir)/.git && cd $(top_srcdir) \ + @if (test -e $(top_srcdir)/.git && cd $(top_srcdir) \ && git rev-parse --verify HEAD) > revision-t 2>/dev/null \ && ! cmp -s revision-t $@; then \ mv -f revision-t $@; \