Skip to content

Commit 14d8729

Browse files
ChrisJohnsengitster
authored andcommitted
git-rebase--interactive.sh: replace cut with ${v%% *}
Some versions of cut do not cope well with lines that do not end in an LF. In this case, we can completely avoid cut by using the ${var%% *} parameter expansion (suggested by Brandon Casey). I found this problem when t3404's "avoid unnecessary reset" failed due to the "rebase -i" not avoiding updating the tested timestamp. On a Mac OS X 10.4.11 system: % printf '%s' 'foo bar' | /usr/bin/cut -d ' ' -f 1 cut: stdin: Illegal byte sequence Signed-off-by: Chris Johnsen <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 84d6940 commit 14d8729

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-rebase--interactive.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ skip_unnecessary_picks () {
626626
case "$fd,$command" in
627627
3,pick|3,p)
628628
# pick a commit whose parent is current $ONTO -> skip
629-
sha1=$(printf '%s' "$rest" | cut -d ' ' -f 1)
629+
sha1=${rest%% *}
630630
case "$(git rev-parse --verify --quiet "$sha1"^)" in
631631
"$ONTO"*)
632632
ONTO=$sha1

0 commit comments

Comments
 (0)