aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-09-06 18:20:09 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-09-06 18:20:09 +0200
commit6f7340c123185c14c204470795e41a6cfb15d819 (patch)
tree773b6cda11fc48937c68b8a70ef5b3074dec236f
parente36982eb67caf56063127091377b922528a916be (diff)
Handle git submodules in version module
-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 ();