diff options
| author | Phillip Wood <phillip.wood@dunelm.org.uk> | 2022-10-12 09:35:05 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-10-17 12:55:03 -0700 |
| commit | 57a1498592986c7532a37dd7f3eb96dc72d75878 (patch) | |
| tree | c1ef2c03da933c9c57c72416e3002b0639df5400 /git-gui/lib/diff.tcl | |
| parent | a524c627a424171c9cc2be2258725adc3f0bcc5a (diff) | |
rebase --apply: remove duplicated code
Use move_to_original_branch() when reattaching HEAD after a fast-forward
rather than open coding a copy of that code. move_to_original_branch()
does not call reset_head() if head_name is NULL but there should be no
user visible changes even though we currently call reset_head() in that
case. The reason for this is that the reset_head() call does not add a
message to the reflog because we're not changing the commit that HEAD
points to and so lock_ref_for_update() elides the update. When head_name
is not NULL then reset_head() behaves like "git symbolic-ref" and so the
reflog is updated.
Note that the removal of "strbuf_release(&msg)" is safe as there is an
identical call just above this hunk which can be seen by viewing the
diff with -U6.
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-gui/lib/diff.tcl')
0 files changed, 0 insertions, 0 deletions
