File tools/diff/diff.cpp changed (mode: 100644) (index ed873e7..6be527d) |
... |
... |
run(Environment &env, const Args &args) |
143 |
143 |
const std::string oldFile = (args.gitDiff ? args.pos[1] : args.pos[0]); |
const std::string oldFile = (args.gitDiff ? args.pos[1] : args.pos[0]); |
144 |
144 |
const std::string newFile = (args.gitDiff ? args.pos[4] : args.pos[1]); |
const std::string newFile = (args.gitDiff ? args.pos[4] : args.pos[1]); |
145 |
145 |
|
|
146 |
|
// New file should be in-tree. |
|
147 |
|
Attrs attrs = env.getConfig().lookupAttrs(newFile); |
|
|
146 |
|
const int newNameIdx = (args.gitRename ? 7 : 0); |
|
147 |
|
|
|
148 |
|
// Using new file for attributes under assumption that it better matches |
|
149 |
|
// user's expectations (e.g., new location reflects file's properties |
|
150 |
|
// better). |
|
151 |
|
Attrs attrs = env.getConfig().lookupAttrs(args.pos[newNameIdx]); |
148 |
152 |
|
|
149 |
153 |
TimeReport &tr = env.getTimeKeeper(); |
TimeReport &tr = env.getTimeKeeper(); |
150 |
154 |
TimeReport nestedTr(tr); |
TimeReport nestedTr(tr); |
|
... |
... |
run(Environment &env, const Args &args) |
186 |
190 |
std::cout); |
std::cout); |
187 |
191 |
if (args.gitDiff) { |
if (args.gitDiff) { |
188 |
192 |
printer.addHeader({ args.pos[3], args.pos[6] }); |
printer.addHeader({ args.pos[3], args.pos[6] }); |
189 |
|
const int newNameIdx = (args.gitRename ? 7 : 0); |
|
190 |
193 |
printer.addHeader({ "a/" + args.pos[0], "b/" + args.pos[newNameIdx] }); |
printer.addHeader({ "a/" + args.pos[0], "b/" + args.pos[newNameIdx] }); |
191 |
194 |
} else { |
} else { |
192 |
195 |
printer.addHeader({ oldFile, newFile }); |
printer.addHeader({ oldFile, newFile }); |
File tools/gdiff/ZSDiff.cpp changed (mode: 100644) (index 9d92d0b..04ca9ac) |
... |
... |
ZSDiff::loadDiff(const DiffEntry &diffEntry) |
302 |
302 |
|
|
303 |
303 |
updateTitle(); |
updateTitle(); |
304 |
304 |
|
|
305 |
|
// New file should be in-tree. |
|
|
305 |
|
// Using new file for attributes under assumption that it better matches |
|
306 |
|
// user's expectations (e.g., new location reflects file's properties |
|
307 |
|
// better). |
306 |
308 |
Attrs attrs = env.getConfig().lookupAttrs(diffEntry.updated.path); |
Attrs attrs = env.getConfig().lookupAttrs(diffEntry.updated.path); |
307 |
309 |
|
|
308 |
310 |
// TODO: parse in parallel like zs-diff does. |
// TODO: parse in parallel like zs-diff does. |