diff options
| author | Vicent Martà <vicent@github.com> | 2013-09-03 12:29:18 -0700 |
|---|---|---|
| committer | Vicent Martà <vicent@github.com> | 2013-09-03 12:29:18 -0700 |
| commit | 6208bd499b1d3dc1a106a35c499e92c3f8f3d238 (patch) | |
| tree | 38761cfbcaf4de35694d8d9bd7c8ec9a50508c9b /src | |
| parent | 37fc44ddff9d8d41e3a8c29c8ce06a253a6bc20f (diff) | |
| parent | 17c7fbf6d276443344c54f55800367b9837c0259 (diff) | |
| download | libgit2-6208bd499b1d3dc1a106a35c499e92c3f8f3d238.tar.gz | |
Merge pull request #1804 from ethomson/rewrites
Minor changes for rewrites
Diffstat (limited to 'src')
| -rw-r--r-- | src/diff_tform.c | 6 | ||||
| -rw-r--r-- | src/status.c | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/diff_tform.c b/src/diff_tform.c index 6b8cf446e..cbe8bafbd 100644 --- a/src/diff_tform.c +++ b/src/diff_tform.c @@ -799,6 +799,9 @@ int git_diff_find_similar( if (is_rename_target(diff, &opts, t, sigcache)) ++num_tgts; + + if ((tgt->flags & GIT_DIFF_FLAG__TO_SPLIT) != 0) + num_rewrites++; } /* if there are no candidate srcs or tgts, we're done */ @@ -1036,7 +1039,8 @@ find_best_matches: if (num_rewrites > 0 || num_updates > 0) error = apply_splits_and_deletes( diff, diff->deltas.length - num_rewrites, - FLAG_SET(&opts, GIT_DIFF_BREAK_REWRITES)); + FLAG_SET(&opts, GIT_DIFF_BREAK_REWRITES) && + !FLAG_SET(&opts, GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY)); cleanup: git__free(tgt2src); diff --git a/src/status.c b/src/status.c index b2353258b..4a0d65092 100644 --- a/src/status.c +++ b/src/status.c @@ -284,8 +284,10 @@ int git_status_list_new( diffopt.flags = diffopt.flags | GIT_DIFF_IGNORE_SUBMODULES; if ((flags & GIT_STATUS_OPT_RENAMES_FROM_REWRITES) != 0) - findopt.flags = findopt.flags | GIT_DIFF_FIND_AND_BREAK_REWRITES | - GIT_DIFF_FIND_RENAMES_FROM_REWRITES; + findopt.flags = findopt.flags | + GIT_DIFF_FIND_AND_BREAK_REWRITES | + GIT_DIFF_FIND_RENAMES_FROM_REWRITES | + GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY; if (show != GIT_STATUS_SHOW_WORKDIR_ONLY) { if ((error = git_diff_tree_to_index( |
