MCPcopy Create free account
hub / github.com/AGWA/git-crypt / get_path_to_top

Function get_path_to_top

commands.cpp:348–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346}
347
348static 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
368static void get_git_status (std::ostream& output)
369{

Callers 2

get_encrypted_filesFunction · 0.85
statusFunction · 0.85

Calls 3

successful_exitFunction · 0.85
exec_commandFunction · 0.85
ErrorClass · 0.85

Tested by

no test coverage detected