summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin-pickaxe.c1
-rw-r--r--diff.h1
-rw-r--r--diffcore-rename.c6
3 files changed, 7 insertions, 1 deletions
diff --git a/builtin-pickaxe.c b/builtin-pickaxe.c
index f6e861a26d..97b3732419 100644
--- a/builtin-pickaxe.c
+++ b/builtin-pickaxe.c
@@ -289,6 +289,7 @@ static struct origin *find_rename(struct scoreboard *sb,
diff_opts.recursive = 1;
diff_opts.detect_rename = DIFF_DETECT_RENAME;
diff_opts.output_format = DIFF_FORMAT_NO_OUTPUT;
+ diff_opts.single_follow = origin->path;
paths[0] = NULL;
diff_tree_setup_paths(paths, &diff_opts);
if (diff_setup_done(&diff_opts) < 0)
diff --git a/diff.h b/diff.h
index ce3058e437..6fda92a7b5 100644
--- a/diff.h
+++ b/diff.h
@@ -46,6 +46,7 @@ struct diff_options {
const char *filter;
const char *orderfile;
const char *pickaxe;
+ const char *single_follow;
unsigned recursive:1,
tree_in_recursive:1,
binary:1,
diff --git a/diffcore-rename.c b/diffcore-rename.c
index ef239012b6..57a74b6bb8 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -256,11 +256,15 @@ void diffcore_rename(struct diff_options *options)
for (i = 0; i < q->nr; i++) {
struct diff_filepair *p = q->queue[i];
- if (!DIFF_FILE_VALID(p->one))
+ if (!DIFF_FILE_VALID(p->one)) {
if (!DIFF_FILE_VALID(p->two))
continue; /* unmerged */
+ else if (options->single_follow &&
+ strcmp(options->single_follow, p->two->path))
+ continue; /* not interested */
else
locate_rename_dst(p->two, 1);
+ }
else if (!DIFF_FILE_VALID(p->two)) {
/* If the source is a broken "delete", and
* they did not really want to get broken,