Skip to content

Commit

Permalink
Added checks to version api's to throw exception when information is …
Browse files Browse the repository at this point in the history
…not available

Signed-off-by: Manoj Takasi <[email protected]>
  • Loading branch information
Manoj Takasi committed Sep 20, 2024
1 parent 3d6257e commit 7623356
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions build/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Build-Depends: cmake,
pkg-config,
protobuf-compiler,
rapidjson-dev,
systemtap-sdt-dev,
uuid-dev,
Standards-Version: 4.5.0

Expand Down
10 changes: 10 additions & 0 deletions src/CMake/version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)

#Set XRT_HEAD_COMMITS to default value if above command is not executed
if (NOT XRT_HEAD_COMMITS)
set (XRT_HEAD_COMMITS -1)
endif()

# Get number of commits between HEAD and master
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-list --count HEAD ^origin/master
Expand All @@ -44,6 +49,11 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)

#Set XRT_BRANCH_COMMITS to default value if above command is not executed
if (NOT XRT_BRANCH_COMMITS)
set (XRT_BRANCH_COMMITS -1)
endif()

# Get the latest abbreviated commit hash date of the working branch
execute_process(
COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:%cD
Expand Down

0 comments on commit 7623356

Please sign in to comment.