summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin-apply.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/builtin-apply.c b/builtin-apply.c
index 2a40af3..1beebe5 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -2516,9 +2516,15 @@ static void prefix_patches(struct patch *p)
if (!prefix)
return;
for ( ; p; p = p->next) {
- if (p->new_name != p->old_name)
+ if (p->new_name == p->old_name) {
+ char *prefixed = p->new_name;
+ prefix_one(&prefixed);
+ p->new_name = p->old_name = prefixed;
+ }
+ else {
prefix_one(&p->new_name);
- prefix_one(&p->old_name);
+ prefix_one(&p->old_name);
+ }
}
}