| 340 | } |
| 341 | |
| 342 | Diff Repository::diffIndexToWorkdir(const Index &index, |
| 343 | Diff::Callbacks *callbacks, |
| 344 | bool ignoreWhitespace) const { |
| 345 | git_diff_options opts = GIT_DIFF_OPTIONS_INIT; |
| 346 | opts.flags |= (GIT_DIFF_INCLUDE_TYPECHANGE | GIT_DIFF_DISABLE_MMAP); |
| 347 | |
| 348 | if (!appConfig().value<bool>("untracked.hide", false)) |
| 349 | opts.flags |= GIT_DIFF_INCLUDE_UNTRACKED | GIT_DIFF_RECURSE_UNTRACKED_DIRS; |
| 350 | |
| 351 | if (ignoreWhitespace) |
| 352 | opts.flags |= GIT_DIFF_IGNORE_WHITESPACE; |
| 353 | |
| 354 | if (callbacks) { |
| 355 | opts.progress_cb = &Diff::Callbacks::progress; |
| 356 | opts.payload = callbacks; |
| 357 | } |
| 358 | |
| 359 | git_diff *diff = nullptr; |
| 360 | git_diff_index_to_workdir(&diff, d->repo, index, &opts); |
| 361 | return Diff(diff); |
| 362 | } |
| 363 | |
| 364 | Reference Repository::head() const { |
| 365 | git_reference *ref = nullptr; |
no test coverage detected