GCC Code Coverage Report


Directory: cvmfs/
File: cvmfs/server_tool_impl.h
Date: 2026-06-28 02:36:10
Exec Total Coverage
Lines: 0 18 0.0%
Branches: 0 18 0.0%

Line Branch Exec Source
1 /**
2 * This file is part of the CernVM File System.
3 */
4
5 #ifndef CVMFS_SERVER_TOOL_IMPL_H_
6 #define CVMFS_SERVER_TOOL_IMPL_H_
7
8 #include <string>
9
10 #include "server_tool.h"
11
12 template<class ObjectFetcherT>
13 manifest::Reflog *ServerTool::FetchReflog(ObjectFetcherT *object_fetcher,
14 const std::string &repo_name,
15 const shash::Any &reflog_hash) {
16 // try to fetch the Reflog from the backend storage first
17 manifest::Reflog *reflog = NULL;
18 typename ObjectFetcherT::Failures const f = object_fetcher->FetchReflog(reflog_hash,
19 &reflog);
20
21 switch (f) {
22 case ObjectFetcherT::kFailOk:
23 LogCvmfs(kLogCvmfs, kLogDebug, "fetched reflog '%s' from backend storage",
24 reflog->database_file().c_str());
25 break;
26
27 case ObjectFetcherT::kFailNotFound:
28 LogCvmfs(kLogCvmfs, kLogStderr,
29 "reflog for '%s' not found but reflog checksum is present "
30 "(either in the manifest key 'Y' or in the reflog.chksum file); "
31 "run `cvmfs_server check -r` to fix.",
32 repo_name.c_str());
33 return NULL;
34
35 case ObjectFetcherT::kFailBadData:
36 LogCvmfs(kLogCvmfs, kLogStderr,
37 "data corruption in .cvmfsreflog for %s, run "
38 "`cvmfs_server check -r` to fix",
39 repo_name.c_str());
40 return NULL;
41
42 default:
43 LogCvmfs(kLogCvmfs, kLogStderr, "failed loading reflog (%d - %s)", f,
44 Code2Ascii(f));
45 return NULL;
46 }
47
48 assert(reflog != NULL);
49 return reflog;
50 }
51
52 #endif // CVMFS_SERVER_TOOL_IMPL_H_
53