mirror of
https://github.com/AGWA/git-crypt.git
synced 2025-12-29 14:15:05 -08:00
Error message if you try to lock repository that's not locked
This commit is contained in:
@@ -914,6 +914,15 @@ int lock (int argc, const char** argv)
|
||||
}
|
||||
} else {
|
||||
// just handle the given key
|
||||
if (access(get_internal_key_path(key_name).c_str(), F_OK) == -1 && errno == ENOENT) {
|
||||
std::clog << "Error: this repository is not currently locked";
|
||||
if (key_name) {
|
||||
std::clog << " with key '" << key_name << "'";
|
||||
}
|
||||
std::clog << "." << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
unlink_internal_key(key_name);
|
||||
unconfigure_git_filters(key_name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user