Skip to content

Commit 31bff64

Browse files
moygitster
authored andcommitted
rebase-i: explicitly accept tab as separator in commands
The git-rebase-todo is parsed several times with different parsers. In principle, the user input is normalized by transform_todo_ids and further parsing can be stricter. In case the user wrote pick deadbee<TAB>commit message the parser of transform_todo_ids was considering the sha1 to be "deadbeef<TAB>commit", and was leaving the tab in the transformed sheet. In practice, this went unnoticed since the actual command interpretation was done later in do_next which did accept the tab as a separator. Make it explicit in the code of transform_todo_ids that tabs are accepted. This way, code that mimicks it will also accept tabs as separator. A similar construct appears in skip_unnecessary_picks, but this one comes after transform_todo_ids, hence reads the normalized format, so it needs not be changed. Signed-off-by: Matthieu Moy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 804098b commit 31bff64

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

git-rebase--interactive.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,8 +732,8 @@ transform_todo_ids () {
732732
# that do not have a SHA-1 at the beginning of $rest.
733733
;;
734734
*)
735-
sha1=$(git rev-parse --verify --quiet "$@" ${rest%% *}) &&
736-
rest="$sha1 ${rest#* }"
735+
sha1=$(git rev-parse --verify --quiet "$@" ${rest%%[ ]*}) &&
736+
rest="$sha1 ${rest#*[ ]}"
737737
;;
738738
esac
739739
printf '%s\n' "$command${rest:+ }$rest"

0 commit comments

Comments
 (0)