Skip to content

Commit 027c7d0

Browse files
committed
C#: Add fallback for branch detection.
Apparently, when building a release build, we're getting `no-git` as first part o the version string for the submodule. If we do, fall back to the internal repo's branch name. For releases, that's the same anyways. Luckily, the commit SHA is correct.
1 parent 06aa266 commit 027c7d0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

csharp/scripts/gen-git-assembly-info.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ def options():
2323
gitfiles[file.name] = file
2424

2525
version_string = gitfiles["git-ql-describe-all.log"].read_text().strip()
26+
if version_string == "no-git":
27+
version_string = gitfiles["git-describe-all.log"].read_text().strip()
2628
version_string += f" ({gitfiles['git-ql-rev-parse.log'].read_text().strip()})"
2729

2830
output_file = pathlib.Path(opts.output)

0 commit comments

Comments
 (0)