]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/rebase.c
builtin rebase: only store fully-qualified refs in `options.head_name`
authorPratik Karki <predatoramigo@gmail.com>
Tue, 4 Sep 2018 21:27:20 +0000 (14:27 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 6 Sep 2018 18:55:43 +0000 (11:55 -0700)
commitd4c569f8f4c67e3846303f772e1b6bdbabf98297
tree55a38fcb5a815d7033adbefa9c9bf30e8061222b
parentc54dacb50ea6d99a1fd9ad0abd5e64dd9914295e
builtin rebase: only store fully-qualified refs in `options.head_name`

When running a rebase on a detached HEAD, we currently store the string
"detached HEAD" in options.head_name. That is a faithful translation of
the shell script version, and we still kind of need it for the purposes of
the scripted backends.

It is poor style for C, though, where we would really only want a valid,
fully-qualified ref name as value, and NULL for detached HEADs, using
"detached HEAD" for display only. Make it so.

Signed-off-by: Pratik Karki <predatoramigo@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rebase.c