From: Junio C Hamano Date: Thu, 12 Dec 2013 22:22:59 +0000 (-0800) Subject: Merge branch 'jn/scripts-updates' X-Git-Tag: v1.9-rc0~71 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/694a88a309c74ffeefa9a0db0396ee4c168a521c?hp=-c Merge branch 'jn/scripts-updates' * jn/scripts-updates: remove #!interpreter line from shell libraries test: replace shebangs with descriptions in shell libraries test: make FILEMODE a lazy prereq contrib: remove git-p4import mark contributed hooks executable mark perl test scripts executable mark Windows build scripts executable --- 694a88a309c74ffeefa9a0db0396ee4c168a521c diff --combined contrib/completion/git-completion.bash index 874611db56,be61931627..51c2dd4dec --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@@ -1,5 -1,3 +1,3 @@@ - #!bash - # # bash/zsh completion support for core Git. # # Copyright (C) 2006,2007 Shawn O. Pearce @@@ -673,6 -671,7 +671,6 @@@ __git_list_porcelain_commands ( index-pack) : plumbing;; init-db) : deprecated;; local-fetch) : plumbing;; - lost-found) : infrequent;; ls-files) : plumbing;; ls-remote) : plumbing;; ls-tree) : plumbing;; @@@ -686,12 -685,14 +684,12 @@@ pack-refs) : plumbing;; parse-remote) : plumbing;; patch-id) : plumbing;; - peek-remote) : plumbing;; prune) : plumbing;; prune-packed) : plumbing;; quiltimport) : import;; read-tree) : plumbing;; receive-pack) : plumbing;; remote-*) : transport;; - repo-config) : deprecated;; rerere) : plumbing;; rev-list) : plumbing;; rev-parse) : plumbing;; @@@ -704,6 -705,7 +702,6 @@@ ssh-*) : transport;; stripspace) : plumbing;; symbolic-ref) : plumbing;; - tar-tree) : deprecated;; unpack-file) : plumbing;; unpack-objects) : plumbing;; update-index) : plumbing;; diff --combined t/lib-read-tree.sh index ef079afc46,6442ae3375..b95f485606 --- a/t/lib-read-tree.sh +++ b/t/lib-read-tree.sh @@@ -1,43 -1,41 +1,41 @@@ - #!/bin/sh - # # Helper functions to check if read-tree would succeed/fail as expected with # and without the dry-run option. They also test that the dry-run does not # write the index and that together with -u it doesn't touch the work tree. # read_tree_must_succeed () { - git ls-files -s >pre-dry-run && - git read-tree -n "$@" && - git ls-files -s >post-dry-run && - test_cmp pre-dry-run post-dry-run && - git read-tree "$@" + git ls-files -s >pre-dry-run && + git read-tree -n "$@" && + git ls-files -s >post-dry-run && + test_cmp pre-dry-run post-dry-run && + git read-tree "$@" } read_tree_must_fail () { - git ls-files -s >pre-dry-run && - test_must_fail git read-tree -n "$@" && - git ls-files -s >post-dry-run && - test_cmp pre-dry-run post-dry-run && - test_must_fail git read-tree "$@" + git ls-files -s >pre-dry-run && + test_must_fail git read-tree -n "$@" && + git ls-files -s >post-dry-run && + test_cmp pre-dry-run post-dry-run && + test_must_fail git read-tree "$@" } read_tree_u_must_succeed () { - git ls-files -s >pre-dry-run && - git diff-files -p >pre-dry-run-wt && - git read-tree -n "$@" && - git ls-files -s >post-dry-run && - git diff-files -p >post-dry-run-wt && - test_cmp pre-dry-run post-dry-run && - test_cmp pre-dry-run-wt post-dry-run-wt && - git read-tree "$@" + git ls-files -s >pre-dry-run && + git diff-files -p >pre-dry-run-wt && + git read-tree -n "$@" && + git ls-files -s >post-dry-run && + git diff-files -p >post-dry-run-wt && + test_cmp pre-dry-run post-dry-run && + test_cmp pre-dry-run-wt post-dry-run-wt && + git read-tree "$@" } read_tree_u_must_fail () { - git ls-files -s >pre-dry-run && - git diff-files -p >pre-dry-run-wt && - test_must_fail git read-tree -n "$@" && - git ls-files -s >post-dry-run && - git diff-files -p >post-dry-run-wt && - test_cmp pre-dry-run post-dry-run && - test_cmp pre-dry-run-wt post-dry-run-wt && - test_must_fail git read-tree "$@" + git ls-files -s >pre-dry-run && + git diff-files -p >pre-dry-run-wt && + test_must_fail git read-tree -n "$@" && + git ls-files -s >post-dry-run && + git diff-files -p >post-dry-run-wt && + test_cmp pre-dry-run post-dry-run && + test_cmp pre-dry-run-wt post-dry-run-wt && + test_must_fail git read-tree "$@" } diff --combined t/test-lib.sh index d303e6c943,c3e07b9e16..1cf78d5b11 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@@ -1,4 -1,4 +1,4 @@@ - #!/bin/sh + # Test framework for git. See t/README for usage. # # Copyright (c) 2005 Junio C Hamano # @@@ -26,10 -26,6 +26,10 @@@ the # outside of t/, e.g. for running tests on the test library # itself. TEST_DIRECTORY=$(pwd) +else + # ensure that TEST_DIRECTORY is an absolute path so that it + # is valid even if the current working directory is changed + TEST_DIRECTORY=$(cd "$TEST_DIRECTORY" && pwd) || exit 1 fi if test -z "$TEST_OUTPUT_DIRECTORY" then @@@ -577,11 -573,9 +577,9 @@@ the make_valgrind_symlink () { # handle only executables, unless they are shell libraries that - # need to be in the exec-path. We will just use "#!" as a - # guess for a shell-script, since we have no idea what the user - # may have configured as the shell path. + # need to be in the exec-path. test -x "$1" || - test "#!" = "$(head -c 2 <"$1")" || + test "# " = "$(head -c 2 <"$1")" || return; base=$(basename "$1") @@@ -834,6 -828,10 +832,10 @@@ test_lazy_prereq SYMLINKS ln -s x y && test -h y ' + test_lazy_prereq FILEMODE ' + test "$(git config --bool core.filemode)" = true + ' + test_lazy_prereq CASE_INSENSITIVE_FS ' echo good >CamelCase && echo bad >camelcase &&