[PATCH] Fix failing test t3700-add.sh

2016-07-29 Thread Ingo Brückl
At the time of the test xfoo1 already exists and is a link. As a result, the check for file mode 100644 fails. Create not yet existing file xfoo instead. Signed-off-by: Ingo Brückl <i...@wupperonline.de> --- t/t3700-add.sh | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-)

[PATCH v2 3/3] Simplify test t3700-add.sh

2016-07-29 Thread Ingo Brückl
Utilize the test_mode_in_index helper function. Signed-off-by: Ingo Brückl <i...@wupperonline.de> --- t/t3700-add.sh | 30 ++ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/t/t3700-add.sh b/t/t3700-add.sh index c08ec9e..0e21a52 100755 --- a/t

[PATCH v2 1/3] Enhance test t3700-add.sh

2016-07-29 Thread Ingo Brückl
The files to be tested may already exist and be links which will make the test fail. So ensure that we are working in a clean environment. Signed-off-by: Ingo Brückl <i...@wupperonline.de> --- t/t3700-add.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/t/t3700-add.sh b/t/t3700-

[PATCH v2 2/3] Make test t3700-add.sh more robust

2016-07-29 Thread Ingo Brückl
Don't rely on chmod to work on the underlying platform (although it wouldn't harm the result of the '--chmod=-x' test). Directly check the result of the --chmod option. Add a test_mode_in_index helper function in order to check for success. Signed-off-by: Ingo Brückl <i...@wupperonline

[PATCH v3 2/3] t3700: merge two tests into one

2016-07-30 Thread Ingo Brückl
on the same file. Signed-off-by: Ingo Brückl <i...@wupperonline.de> --- t/t3700-add.sh | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/t/t3700-add.sh b/t/t3700-add.sh index 494f5b8..1fa5dfd 100755 --- a/t/t3700-add.sh +++ b/t/t3700-add.sh @@ -332,24 +

[PATCH v3 1/3] t3700: remove unwanted leftover files before running new tests

2016-07-30 Thread Ingo Brückl
ct the modes of xfoo1 as this test expects. Fix this by starting the test with "rm -f xfoo1" to make sure the file is created from scratch, and do the same to other similar tests. Signed-off-by: Ingo Brückl <i...@wupperonline.de> --- t/t3700-add.sh | 3 +++ 1 file changed, 3 insertion

[PATCH v3 3/3] t3700: add a test_mode_in_index helper function

2016-07-30 Thread Ingo Brückl
The case statement to check the file mode of a staged file appears a number of times. Simplify the test by utilizing a test_mode_in_index helper function. Signed-off-by: Ingo Brückl <i...@wupperonline.de> --- t/t3700-add.sh | 54 ++