diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/branch.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/builtin/branch.c b/builtin/branch.c index 89f64f4123..e2e3692838 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -506,12 +506,9 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int oldref.buf + 11); } - if (replace_each_worktree_head_symref(oldref.buf, newref.buf, logmsg.buf)) { - if (copy) - die(_("Branch copied to %s, but HEAD is not updated!"), newname); - else - die(_("Branch renamed to %s, but HEAD is not updated!"), newname); - } + if (!copy && + replace_each_worktree_head_symref(oldref.buf, newref.buf, logmsg.buf)) + die(_("Branch renamed to %s, but HEAD is not updated!"), newname); strbuf_release(&logmsg); |