mirror of
https://github.com/AGWA/git-crypt.git
synced 2025-12-28 05:33:47 -08:00
When encrypting, use temporary file if file gets too big
This commit is contained in:
@@ -19,11 +19,14 @@ static void print_usage (const char* argv0)
|
||||
|
||||
|
||||
int main (int argc, const char** argv)
|
||||
{
|
||||
try {
|
||||
// The following two lines are essential for achieving good performance:
|
||||
std::ios_base::sync_with_stdio(false);
|
||||
std::cin.tie(0);
|
||||
|
||||
std::cin.exceptions(std::ios_base::badbit);
|
||||
std::cout.exceptions(std::ios_base::badbit);
|
||||
|
||||
if (argc < 3) {
|
||||
print_usage(argv[0]);
|
||||
return 2;
|
||||
@@ -46,6 +49,8 @@ int main (int argc, const char** argv)
|
||||
}
|
||||
|
||||
return 0;
|
||||
} catch (const std::ios_base::failure& e) {
|
||||
std::cerr << "git-crypt: I/O error: " << e.what() << std::endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user