diff options
-rw-r--r-- | lisp/km-magit.el | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/km-magit.el b/lisp/km-magit.el index 0ea2b02..332dc30 100644 --- a/lisp/km-magit.el +++ b/lisp/km-magit.el @@ -220,13 +220,14 @@ argument CHOOSE-SUFFIX, prompt for a suffix to use instead of branch))) branches)) (pcase-dolist (`(,branch-short . ,branch-full) branches) - (if (magit-git-success "update-ref" - (replace-regexp-in-string "refs/heads/" - "refs/archive/" - branch-full) - branch-full) - (magit-run-git "branch" "-D" branch-short) - (error "update-ref call failed"))) + (let ((new (replace-regexp-in-string "refs/heads/" + "refs/archive/" + branch-full))) + (if (magit-git-success "update-ref" new branch-full) + (progn + (magit--rename-reflog-file branch-full new) + (magit-run-git "branch" "-D" branch-short)) + (error "update-ref call failed")))) (message (concat "Archived " (let ((num-branches (length branches))) (if (= num-branches 1) |