| 69 | } |
| 70 | |
| 71 | static std::string git_version_string () |
| 72 | { |
| 73 | std::vector<std::string> command; |
| 74 | command.push_back("git"); |
| 75 | command.push_back("version"); |
| 76 | |
| 77 | std::stringstream output; |
| 78 | if (!successful_exit(exec_command(command, output))) { |
| 79 | throw Error("'git version' failed - is Git installed?"); |
| 80 | } |
| 81 | std::string word; |
| 82 | output >> word; // "git" |
| 83 | output >> word; // "version" |
| 84 | output >> word; // "1.7.10.4" |
| 85 | return word; |
| 86 | } |
| 87 | |
| 88 | static std::vector<int> parse_version (const std::string& str) |
| 89 | { |
no test coverage detected