We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c243c11 commit 2a55509Copy full SHA for 2a55509
src/global/internal/appinfo.cpp
@@ -13,7 +13,12 @@ AppInfo::AppInfo(QObject *parent) :
13
14
QString scratchcpp::AppInfo::revision() const
15
{
16
- return git_CommitSHA1();
+ QString rev = git_CommitSHA1();
17
+
18
+ if (rev.size() >= 8)
19
+ return rev.first(8);
20
21
+ return "";
22
}
23
24
int scratchcpp::AppInfo::buildYear() const
src/global/test/appinfo.cpp
@@ -15,7 +15,9 @@ using namespace scratchcpp::test;
TEST(AppInfoTest, Revision)
AppInfo info;
- ASSERT_EQ(info.revision(), git_CommitSHA1());
+ ASSERT_GE(rev.size(), 8);
+ ASSERT_EQ(info.revision(), rev.first(8));
TEST(AppInfoTest, BuildYear)
0 commit comments