path: root/test-chmtime.c
AgeCommit message (Collapse)Author
2016-04-15test helpers: move test-* to t/helper/ subdirectoryNguyễn Thái Ngọc Duy
This keeps top dir a bit less crowded. And because these programs are for testing purposes, it makes sense that they stay somewhere in t/ Signed-off-by: Nguyễn Thái Ngọc Duy <> Signed-off-by: Junio C Hamano <>
2014-03-31comments: fix misuses of "nor"Justin Lebar
Signed-off-by: Justin Lebar <> Signed-off-by: Junio C Hamano <>
2013-06-20Merge branch 'js/test-ln-s-add'Junio C Hamano
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
2013-06-11Merge branch 'rj/mingw-cygwin'Junio C Hamano
Update build for Cygwin 1.[57]. Torsten Bögershausen reports that this is fine with Cygwin 1.7 ($gmane/225824) so let's try moving it ahead. * rj/mingw-cygwin: cygwin: Remove the CYGWIN_V15_WIN32API build variable mingw: rename WIN32 cpp macro to GIT_WINDOWS_NATIVE
2013-06-02test-chmtime: Fix exit code on WindowsJohannes Sixt
MinGW's bash does not recognize an exit code -1 as failure. See also 47e3de0e (MinGW: truncate exit()'s argument to lowest 8 bits) and 2488df84 (builtin run_command: do not exit with -1). Exit code 1 is good enough. Signed-off-by: Johannes Sixt <> Signed-off-by: Junio C Hamano <>
2013-05-08mingw: rename WIN32 cpp macro to GIT_WINDOWS_NATIVEJonathan Nieder
Throughout git, it is assumed that the WIN32 preprocessor symbol is defined on native Windows setups (mingw and msvc) and not on Cygwin. On Cygwin, most of the time git can pretend this is just another Unix machine, and Windows-specific magic is generally counterproductive. Unfortunately Cygwin *does* define the WIN32 symbol in some headers. Best to rely on a new git-specific symbol GIT_WINDOWS_NATIVE instead, defined as follows: #if defined(WIN32) && !defined(__CYGWIN__) # define GIT_WINDOWS_NATIVE #endif After this change, it should be possible to drop the CYGWIN_V15_WIN32API setting without any negative effect. [rj: %s/WINDOWS_NATIVE/GIT_WINDOWS_NATIVE/g ] Signed-off-by: Jonathan Nieder <> Signed-off-by: Ramsay Jones <> Signed-off-by: Junio C Hamano <>
2013-04-28sparse: Fix mingw_main() argument number/type errorsRamsay Jones
Sparse issues 68 errors (two errors for each main() function) such as the following: SP git.c git.c:510:5: error: too many arguments for function mingw_main git.c:510:5: error: symbol 'mingw_main' redeclared with different type \ (originally declared at git.c:510) - different argument counts The errors are caused by the 'main' macro used by the MinGW build to provide a replacement main() function. The original main function is effectively renamed to 'mingw_main' and is called from the new main function. The replacement main is used to execute certain actions common to all git programs on MinGW (e.g. ensure the standard I/O streams are in binary mode). In order to suppress the errors, we change the macro to include the parameters in the declaration of the mingw_main function. Unfortunately, this change provokes both sparse and gcc to complain about 9 calls to mingw_main(), such as the following: CC git.o git.c: In function 'main': git.c:510: warning: passing argument 2 of 'mingw_main' from \ incompatible pointer type git.c:510: note: expected 'const char **' but argument is of \ type 'char **' In order to suppress these warnings, since both of the main functions need to be declared with the same prototype, we change the declaration of the 9 main functions, thus: int main(int argc, char **argv) Signed-off-by: Ramsay Jones <> Signed-off-by: Junio C Hamano <>
2013-02-25tests: use a lowercase "usage:" stringDavid Aguilar
Adjust test commands and test suites so that their usage strings are consistent with Git. Signed-off-by: David Aguilar <> Signed-off-by: Junio C Hamano <>
2010-02-04Typofixes outside documentation areaJunio C Hamano
begining -> beginning canonicalizations -> canonicalization comand -> command dewrapping -> unwrapping dirtyness -> dirtiness DISCLAMER -> DISCLAIMER explicitely -> explicitly feeded -> fed impiled -> implied madatory -> mandatory mimick -> mimic preceeding -> preceding reqeuest -> request substition -> substitution Signed-off-by: Junio C Hamano <>
2009-06-01test-chmtime: work around Windows limitationJohannes Schindelin
Windows has problems changing the mtime when the file is write protected, even by the owner of said file. Add a Windows-only workaround to change the mode if necessary before trying to change the mtime. Signed-off-by: Johannes Schindelin <> Signed-off-by: Steffen Prohaska <> Signed-off-by: Junio C Hamano <>
2008-10-31Add --verbose|-v to test-chmtimeAlex Riesen
This allows us replace perl when getting the mtime of a file because of time zone conversions, though at the moment only one platform which does this has been identified: Cygwin when used with ActiveState Perl (as usual). The output format is: <mtime1> TAB <filename1> <LF> <mtime2> TAB <filename2> <LF> ... which, if only mtime is needed can be parsed with cut(1): test-chmtime -v +0 filename1 | cut -f 1 Also, the change adds a description of programs features, with examples. Signed-off-by: Alex Riesen <> Signed-off-by: Junio C Hamano <>
2007-02-25Add test-chmtime: a utility to change mtime on filesEric Wong
This is intended to be a portable replacement for our usage of date(1), touch(1), and Perl one-liners in tests. Usage: test-chtime (+|=|-|=+|=-)<seconds> <file>..." '+' increments the mtime on the files by <seconds> '-' decrements the mtime on the files by <seconds> '=' sets the mtime on the file to exactly <seconds> '=+' and '=-' sets the mtime on the file to <seconds> after or before the current time. Signed-off-by: Eric Wong <> Signed-off-by: Junio C Hamano <>