Use SGBinaryFile in a couple more places.
Most importantly, when computing a hash from the on-disk state.
This commit is contained in:
@@ -843,7 +843,7 @@ HTTPRepository::failure() const
|
||||
sha1_init(&info);
|
||||
char* buf = static_cast<char*>(malloc(1024 * 1024));
|
||||
size_t readLen;
|
||||
SGFile f(p.str());
|
||||
SGBinaryFile f(p.str());
|
||||
if (!f.open(SG_IO_IN)) {
|
||||
throw sg_io_exception("Couldn't open file for compute hash", p);
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ std::string test_computeHashForPath(const SGPath& p)
|
||||
char* buf = static_cast<char*>(alloca(1024 * 1024));
|
||||
size_t readLen;
|
||||
|
||||
SGFile f(p.str());
|
||||
SGBinaryFile f(p.str());
|
||||
f.open(SG_IO_IN);
|
||||
|
||||
while ((readLen = f.read(buf, 1024 * 1024)) > 0) {
|
||||
|
||||
@@ -46,7 +46,7 @@ std::string readFileIntoString(const SGPath& path)
|
||||
std::string contents;
|
||||
|
||||
size_t readLen;
|
||||
SGFile f(path.str());
|
||||
SGBinaryFile f(path.str());
|
||||
if (!f.open(SG_IO_IN)) {
|
||||
throw sg_io_exception("Couldn't open file", path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user