multi: update GetInfoResponse response

Update the output of the `commit_hash` field in the GetInfoResponse.
The `commit_hash` field will contain the most recent commit_hash that
the build was based on. If the build had uncommitted changes, this field
will contain the most recent commit hash, suffixed by "-dirty".

Note that this change also changes the output of `commit` field in the
`--version` command. The `Commit` field will now contain most recent git
commit tag.
This commit is contained in:
Viktor Tigerström 2025-05-22 12:10:30 +02:00
parent 48a5f460b9
commit cdcacfe753
No known key found for this signature in database
GPG key ID: B984570980684DCC
6 changed files with 35 additions and 16 deletions

View file

@ -1249,9 +1249,16 @@ func (s *swapClientServer) GetInfo(ctx context.Context,
}
}
commitHash := loop.CommitHash
if loop.Dirty != "" {
// If the build was dirty, we add a "-dirty" suffix to the
// commit hash.
commitHash += "-" + loop.Dirty
}
return &looprpc.GetInfoResponse{
Version: loop.Version(),
CommitHash: loop.CommitHash(),
CommitHash: commitHash,
Network: s.config.Network,
RpcListen: s.config.RPCListen,
RestListen: s.config.RESTListen,