File tools/diff/diff.cpp changed (mode: 100644) (index 0b9b2d8..2d804b8) |
... |
... |
struct Args : CommonArgs |
47 |
47 |
static boost::program_options::options_description getLocalOpts(); |
static boost::program_options::options_description getLocalOpts(); |
48 |
48 |
static Args parseLocalArgs(const Environment &env); |
static Args parseLocalArgs(const Environment &env); |
49 |
49 |
static int run(Environment &env, const Args &args); |
static int run(Environment &env, const Args &args); |
|
50 |
|
static int gitFallback(const Args &args); |
50 |
51 |
|
|
51 |
52 |
int |
int |
52 |
53 |
main(int argc, char *argv[]) |
main(int argc, char *argv[]) |
|
... |
... |
main(int argc, char *argv[]) |
83 |
84 |
} |
} |
84 |
85 |
|
|
85 |
86 |
if (result != EXIT_SUCCESS && args.gitDiff) { |
if (result != EXIT_SUCCESS && args.gitDiff) { |
86 |
|
if (args.pos[5] == std::string(40U, '0')) { |
|
87 |
|
execlp("git", "git", "diff", "--no-ext-diff", args.pos[2].c_str(), |
|
88 |
|
"--", args.pos[0].c_str(), static_cast<char *>(nullptr)); |
|
89 |
|
exit(127); |
|
90 |
|
} |
|
91 |
|
execlp("git", "git", "diff", "--no-ext-diff", args.pos[2].c_str(), |
|
92 |
|
args.pos[5].c_str(), "--", static_cast<char *>(nullptr)); |
|
93 |
|
exit(127); |
|
|
87 |
|
return gitFallback(args); |
94 |
88 |
} |
} |
95 |
89 |
|
|
96 |
90 |
return result; |
return result; |
|
... |
... |
run(Environment &env, const Args &args) |
198 |
192 |
|
|
199 |
193 |
return EXIT_SUCCESS; |
return EXIT_SUCCESS; |
200 |
194 |
} |
} |
|
195 |
|
|
|
196 |
|
static int |
|
197 |
|
gitFallback(const Args &args) |
|
198 |
|
{ |
|
199 |
|
if (args.pos[5] == std::string(40U, '0')) { |
|
200 |
|
execlp("git", "git", "diff", "--no-ext-diff", args.pos[2].c_str(), |
|
201 |
|
"--", args.pos[0].c_str(), static_cast<char *>(nullptr)); |
|
202 |
|
return 127; |
|
203 |
|
} |
|
204 |
|
execlp("git", "git", "diff", "--no-ext-diff", args.pos[2].c_str(), |
|
205 |
|
args.pos[5].c_str(), "--", static_cast<char *>(nullptr)); |
|
206 |
|
return 127; |
|
207 |
|
} |