@matheusbsbs / matheus-bagliano / commits / 14d872987a
Fork 0

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 <chris_johnsen@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Chris Johnsen committed Sep 17, 2010 at 16:42 UTC 14d872987a270f383e20dc183f4a960cca0f0f36
1 file changed +1 -1
git-rebase--interactive.sh
+1 -1
@@ -626,7 +626,7 @@ skip_unnecessary_picks () {
626 case "$fd,$command" in
627 3,pick|3,p)
628 # pick a commit whose parent is current $ONTO -> skip
629 - sha1=$(printf '%s' "$rest" | cut -d ' ' -f 1)
629 + sha1=${rest%% *}
630 case "$(git rev-parse --verify --quiet "$sha1"^)" in
631 "$ONTO"*)
632 ONTO=$sha1