mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: make get_sha() return std::string
This was crazy: it returned a local static buffer, i.e. was inherently non-reentrant. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
2f3d8d83f5
commit
2f4dbf1848
3 changed files with 7 additions and 7 deletions
|
@ -269,9 +269,9 @@ extern "C" bool remote_repo_uptodate(const char *filename, struct git_info *info
|
|||
std::string current_sha = saved_git_id;
|
||||
|
||||
if (is_git_repository(filename, info) && open_git_repository(info)) {
|
||||
const char *sha = get_sha(info->repo, info->branch);
|
||||
std::string sha = get_sha(info->repo, info->branch);
|
||||
if (!sha.empty() && current_sha == sha) {
|
||||
fprintf(stderr, "already have loaded SHA %s - don't load again\n", sha);
|
||||
fprintf(stderr, "already have loaded SHA %s - don't load again\n", sha.c_str());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue