From 84d694027fbecfc61683aa584725491bf614b5e1 Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Wed, 15 Sep 2010 15:58:22 -0500 Subject: [PATCH 1/2] t/t7300: workaround ancient touch by rearranging arguments The ancient touch on Solaris 7 thinks that a decimal number supplied as the first argument specifies a date_time to give to the files specified by the remaining arguments. In this case, it fails to parse '1' as a proper date_time and exits with a failure status. Workaround this flaw by rearranging the arguments supplied to touch so that a non-digit appears first and touch will not be confused. Signed-off-by: Brandon Casey Signed-off-by: Junio C Hamano --- t/t7300-clean.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh index 7dbbea13ac..6c776e9bec 100755 --- a/t/t7300-clean.sh +++ b/t/t7300-clean.sh @@ -443,7 +443,7 @@ test_expect_success 'git clean -e' ' ( cd repo && git init && - touch 1 2 3 known && + touch known 1 2 3 && git add known && git clean -f -e 1 -e 2 && test -e 1 && From 14d872987a270f383e20dc183f4a960cca0f0f36 Mon Sep 17 00:00:00 2001 From: Chris Johnsen Date: Fri, 17 Sep 2010 16:42:51 -0500 Subject: [PATCH 2/2] 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 Signed-off-by: Junio C Hamano --- git-rebase--interactive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index eb2dff55f8..a27952d9fd 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -626,7 +626,7 @@ skip_unnecessary_picks () { case "$fd,$command" in 3,pick|3,p) # pick a commit whose parent is current $ONTO -> skip - sha1=$(printf '%s' "$rest" | cut -d ' ' -f 1) + sha1=${rest%% *} case "$(git rev-parse --verify --quiet "$sha1"^)" in "$ONTO"*) ONTO=$sha1