aboutsummaryrefslogtreecommitdiff
path: root/build2/version/snapshot.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/version/snapshot.cxx')
-rw-r--r--build2/version/snapshot.cxx6
1 files changed, 4 insertions, 2 deletions
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 ();