From 6f7340c123185c14c204470795e41a6cfb15d819 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 6 Sep 2017 18:20:09 +0200 Subject: Handle git submodules in version module --- build2/version/snapshot.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'build2') diff --git a/build2/version/snapshot.cxx b/build2/version/snapshot.cxx index 00528c7..143c200 100644 --- a/build2/version/snapshot.cxx +++ b/build2/version/snapshot.cxx @@ -15,14 +15,16 @@ namespace build2 snapshot extract_snapshot_git (const dir_path&); - static const dir_path git (".git"); + static const path git (".git"); snapshot extract_snapshot (const scope& rs) { const dir_path& src_root (rs.src_path ()); - if (exists (src_root / git)) + // .git can be either a directory or a file in case of a submodule. + // + if (build2::entry_exists (src_root / git, /* follow_symlinks */ true)) return extract_snapshot_git (src_root); return snapshot (); -- cgit v1.1