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 <dirk@hohndel.org>
This commit is contained in:
parent
42f8e012b7
commit
ca1efdcecd
@ -100,7 +100,7 @@ libdivecomputer.lo: revision.h
|
|||||||
|
|
||||||
FORCE:
|
FORCE:
|
||||||
$(top_srcdir)/revision: 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 \
|
&& git rev-parse --verify HEAD) > revision-t 2>/dev/null \
|
||||||
&& ! cmp -s revision-t $@; then \
|
&& ! cmp -s revision-t $@; then \
|
||||||
mv -f revision-t $@; \
|
mv -f revision-t $@; \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user