| 346 | } |
| 347 | |
| 348 | static std::string get_path_to_top () |
| 349 | { |
| 350 | // git rev-parse --show-cdup |
| 351 | std::vector<std::string> command; |
| 352 | command.push_back("git"); |
| 353 | command.push_back("rev-parse"); |
| 354 | command.push_back("--show-cdup"); |
| 355 | |
| 356 | std::stringstream output; |
| 357 | |
| 358 | if (!successful_exit(exec_command(command, output))) { |
| 359 | throw Error("'git rev-parse --show-cdup' failed - is this a Git repository?"); |
| 360 | } |
| 361 | |
| 362 | std::string path_to_top; |
| 363 | std::getline(output, path_to_top); |
| 364 | |
| 365 | return path_to_top; |
| 366 | } |
| 367 | |
| 368 | static void get_git_status (std::ostream& output) |
| 369 | { |
no test coverage detected