File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,15 +30,15 @@ namespace cgit {
3030 return ss.str ();
3131 }
3232
33- string get_git_file () {
33+ string get_git_file (bool q ) {
3434 auto git = get_env (" GIT" , DEFAULT_GIT_FILE);
3535 if (git == nullptr ) {
3636 printf (" please set the environment variable `GIT`." );
3737 exit (-1 );
3838 }
3939
4040 string git_str (git);
41- if (git_str[0 ] != ' "' ) git_str = ' "' + git_str + ' "' ;
41+ if (q && git_str[0 ] != ' "' ) git_str = ' "' + git_str + ' "' ;
4242
4343 return git_str;
4444 }
Original file line number Diff line number Diff line change 77#include " string.hpp"
88
99namespace cgit {
10- string get_git_file ();
10+ string get_git_file (bool q = true );
1111
1212 int cgit_clone (std::vector<string> &argv);
1313}
Original file line number Diff line number Diff line change @@ -13,5 +13,5 @@ int main(int argc, char **argv) {
1313 }
1414
1515 if (argc > 2 && args[1 ] == " clone" ) return cgit_clone (args);
16- else return execv (get_git_file (), argv);
16+ else return exec (get_git_file (false ), argv);
1717}
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ namespace cgit {
1919 return err == 0 && file != nullptr ? file : default_value;
2020 }
2121
22- int execv (const string &file_name, char const *const *arguments) {
22+ int exec (const string &file_name, char *const *arguments) {
2323 return _execv (file_name.c_str (), arguments);
2424 }
2525
@@ -32,7 +32,7 @@ namespace cgit {
3232 return file ? file : default_value;
3333 }
3434
35- int execv (const string &file_name, char const * const * arguments){
35+ int exec (const string &file_name, char * const * arguments){
3636 return execv (file_name.c_str (), arguments);
3737 }
3838
Original file line number Diff line number Diff line change 44namespace cgit {
55 const char *get_env (const char *name, const char *default_value);
66
7- int execv (const string &file_name, char const *const *arguments);
7+ int exec (const string &file_name, char *const *arguments);
88
99 int cd (const string &path);
1010}
You can’t perform that action at this time.
0 commit comments