From 25641fcdb0d31130fadd649861035cc7db859cf7 Mon Sep 17 00:00:00 2001 From: Brian Gernhardt Date: Mon, 23 Aug 2010 22:37:24 -0400 Subject: [PATCH 1/3] t7610: cd inside subshell instead of around Instead of using `cd dir && (...) && cd..` use `(cd dir && ...)` This ensures that the test doesn't get caught in the subdirectory if there is an error in the subshell. Signed-off-by: Brian Gernhardt Signed-off-by: Junio C Hamano --- t/t7610-mergetool.sh | 49 +++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh index f5a7bf47e9..3bd74042ef 100755 --- a/t/t7610-mergetool.sh +++ b/t/t7610-mergetool.sh @@ -68,22 +68,24 @@ test_expect_success 'mergetool crlf' ' ' test_expect_success 'mergetool in subdir' ' - git checkout -b test3 branch1 - cd subdir && ( - test_must_fail git merge master >/dev/null 2>&1 && - ( yes "" | git mergetool file3 >/dev/null 2>&1 ) && - test "$(cat file3)" = "master new sub") && - cd .. + git checkout -b test3 branch1 && + ( + cd subdir && + test_must_fail git merge master >/dev/null 2>&1 && + ( yes "" | git mergetool file3 >/dev/null 2>&1 ) && + test "$(cat file3)" = "master new sub" + ) ' test_expect_success 'mergetool on file in parent dir' ' - cd subdir && ( - ( yes "" | git mergetool ../file1 >/dev/null 2>&1 ) && - ( yes "" | git mergetool ../file2 >/dev/null 2>&1 ) && - test "$(cat ../file1)" = "master updated" && - test "$(cat ../file2)" = "master new" && - git commit -m "branch1 resolved with mergetool - subdir") && - cd .. + ( + cd subdir && + ( yes "" | git mergetool ../file1 >/dev/null 2>&1 ) && + ( yes "" | git mergetool ../file2 >/dev/null 2>&1 ) && + test "$(cat ../file1)" = "master updated" && + test "$(cat ../file2)" = "master new" && + git commit -m "branch1 resolved with mergetool - subdir" + ) ' test_expect_success 'mergetool skips autoresolved' ' @@ -96,16 +98,17 @@ test_expect_success 'mergetool skips autoresolved' ' ' test_expect_success 'mergetool merges all from subdir' ' - cd subdir && ( - git config rerere.enabled false && - test_must_fail git merge master && - git mergetool --no-prompt && - test "$(cat ../file1)" = "master updated" && - test "$(cat ../file2)" = "master new" && - test "$(cat file3)" = "master new sub" && - git add ../file1 ../file2 file3 && - git commit -m "branch2 resolved by mergetool from subdir") && - cd .. + ( + cd subdir && + git config rerere.enabled false && + test_must_fail git merge master && + git mergetool --no-prompt && + test "$(cat ../file1)" = "master updated" && + test "$(cat ../file2)" = "master new" && + test "$(cat file3)" = "master new sub" && + git add ../file1 ../file2 file3 && + git commit -m "branch2 resolved by mergetool from subdir" + ) ' test_done From 6325ca3129ef969077115ba600d8356b8412b4d2 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Tue, 24 Aug 2010 02:14:53 -0500 Subject: [PATCH 2/3] t3302 (notes): Port to Solaris MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The time_notes script, which uses POSIX shell features, is currently sometimes run with a non-POSIX /bin/sh. Reported-by: Ævar Arnfjörð Bjarmason Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- t/t3302-notes-index-expensive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t3302-notes-index-expensive.sh b/t/t3302-notes-index-expensive.sh index 361a10aeb1..8ab333dbd9 100755 --- a/t/t3302-notes-index-expensive.sh +++ b/t/t3302-notes-index-expensive.sh @@ -98,7 +98,7 @@ time_notes () { for mode in no-notes notes do echo $mode - /usr/bin/time sh ../time_notes $mode $1 + /usr/bin/time "$SHELL_PATH" ../time_notes $mode $1 done } From ef45e4dae0a0f45fc72b7cd34b32dd465a38697d Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Sun, 22 Aug 2010 21:56:38 +0530 Subject: [PATCH 3/3] parse-options: clarify PARSE_OPT_NOARG description Here "takes no argument" means "does not take an argument". The latter phrasing might make it clearer that PARSE_OPT_NOARG does not make an option with an argument that can optionally be left off. Noticed-by: Ramkumar Ramachandra Signed-off-by: Jonathan Nieder Signed-off-by: Ramkumar Ramachandra Signed-off-by: Junio C Hamano --- parse-options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse-options.h b/parse-options.h index 7435cdbf1d..d982f0f1bf 100644 --- a/parse-options.h +++ b/parse-options.h @@ -69,7 +69,7 @@ typedef int parse_opt_cb(const struct option *, const char *arg, int unset); * `flags`:: * mask of parse_opt_option_flags. * PARSE_OPT_OPTARG: says that the argument is optional (not for BOOLEANs) - * PARSE_OPT_NOARG: says that this option takes no argument + * PARSE_OPT_NOARG: says that this option does not take an argument * PARSE_OPT_NONEG: says that this option cannot be negated * PARSE_OPT_HIDDEN: this option is skipped in the default usage, and * shown only in the full usage.