| 238 | } |
| 239 | |
| 240 | static std::string get_internal_state_path () |
| 241 | { |
| 242 | // git rev-parse --git-dir |
| 243 | std::vector<std::string> command; |
| 244 | command.push_back("git"); |
| 245 | command.push_back("rev-parse"); |
| 246 | command.push_back("--git-dir"); |
| 247 | |
| 248 | std::stringstream output; |
| 249 | |
| 250 | if (!successful_exit(exec_command(command, output))) { |
| 251 | throw Error("'git rev-parse --git-dir' failed - is this a Git repository?"); |
| 252 | } |
| 253 | |
| 254 | std::string path; |
| 255 | std::getline(output, path); |
| 256 | path += "/git-crypt"; |
| 257 | |
| 258 | return path; |
| 259 | } |
| 260 | |
| 261 | static std::string get_internal_keys_path (const std::string& internal_state_path) |
| 262 | { |
no test coverage detected