From: Junio C Hamano Date: Thu, 20 Jun 2013 23:02:18 +0000 (-0700) Subject: Merge branch 'js/test-ln-s-add' X-Git-Tag: v1.8.4-rc0~163 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/c0266ed2759fa1838384c37faa6d7264edaaf04b?ds=inline;hp=-c Merge branch 'js/test-ln-s-add' Many tests that check the behaviour of symbolic links stored in the index or the tree objects do not have to be skipped on a filesystem that lack symbolic link support. * js/test-ln-s-add: t4011: remove SYMLINKS prerequisite t6035: use test_ln_s_add to remove SYMLINKS prerequisite t3509, t4023, t4114: use test_ln_s_add to remove SYMLINKS prerequisite t3100: use test_ln_s_add to remove SYMLINKS prerequisite t3030: use test_ln_s_add to remove SYMLINKS prerequisite t0000: use test_ln_s_add to remove SYMLINKS prerequisite tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases) tests: introduce test_ln_s_add t3010: modernize style test-chmtime: Fix exit code on Windows --- c0266ed2759fa1838384c37faa6d7264edaaf04b diff --combined t/README index 35b3c5c2fa,bbe25c31b4..ec52468861 --- a/t/README +++ b/t/README @@@ -324,9 -324,6 +324,9 @@@ Don't use 'test_must_fail git cmd'. This will signal a failure if git dies in an unexpected way (e.g. segfault). + On the other hand, don't use test_must_fail for running regular + platform commands; just use '! cmd'. + - use perl without spelling it as "$PERL_PATH". This is to help our friends on Windows where the platform Perl often adds CR before the end of line, and they bundle Git with a version of Perl that @@@ -595,6 -592,20 +595,20 @@@ library for your script to use test_cmp expected actual ' + - test_ln_s_add + + This function helps systems whose filesystem does not support symbolic + links. Use it to add a symbolic link entry to the index when it is not + important that the file system entry is a symbolic link, i.e., instead + of the sequence + + ln -s foo bar && + git add bar + + Sometimes it is possible to split a test in a part that does not need + the symbolic link in the file system and a part that does; then only + the latter part need be protected by a SYMLINKS prerequisite (see below). + Prerequisites ------------- diff --combined test-chmtime.c index 923bf327f8,2e601a8038..0df748784b --- a/test-chmtime.c +++ b/test-chmtime.c @@@ -56,7 -56,7 +56,7 @@@ static int timespec_arg(const char *arg return 1; } -int main(int argc, const char *argv[]) +int main(int argc, char *argv[]) { static int verbose; @@@ -84,15 -84,15 +84,15 @@@ if (stat(argv[i], &sb) < 0) { fprintf(stderr, "Failed to stat %s: %s\n", argv[i], strerror(errno)); - return -1; + return 1; } -#ifdef WIN32 +#ifdef GIT_WINDOWS_NATIVE if (!(sb.st_mode & S_IWUSR) && chmod(argv[i], sb.st_mode | S_IWUSR)) { fprintf(stderr, "Could not make user-writable %s: %s", argv[i], strerror(errno)); - return -1; + return 1; } #endif @@@ -107,7 -107,7 +107,7 @@@ if (utb.modtime != sb.st_mtime && utime(argv[i], &utb) < 0) { fprintf(stderr, "Failed to modify time on %s: %s\n", argv[i], strerror(errno)); - return -1; + return 1; } } @@@ -115,5 -115,5 +115,5 @@@ usage: fprintf(stderr, "usage: %s %s\n", argv[0], usage_str); - return -1; + return 1; }