Skip to content

Commit eb30a5d

Browse files
committed
vcs: Ensure vcs-git protects user from git stderr.
This change ensures that stderr is not printed when an exact match, as expected, is not found. The stderr from git was confusing to users.
1 parent 681b34e commit eb30a5d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/tools/vcs-git.jam

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@ rule generate-version-string
5151
errors.user-error "vcs-git: $(directory) is not a Git repository." ;
5252
}
5353

54-
v = [ SHELL "(cd $(directory) && git describe --tags --exact-match --dirty)" ] ;
54+
if [ os.name ] = NT
55+
{
56+
v = [ SHELL "(cd $(directory) && git describe --tags --exact-match --dirty) 2> NUL" ] ;
57+
}
58+
else
59+
{
60+
v = [ SHELL "(cd $(directory) && git describe --tags --exact-match --dirty) 2> /dev/null" ] ;
61+
}
5562
v = [ SPLIT_BY_CHARACTERS $(v) : "\n" ] ;
5663

5764
if $(v) != ""

0 commit comments

Comments
 (0)