]> git.ipfire.org Git - thirdparty/git.git/commit
tests: allow testing if a path is truly a file or a directory
authorCOGONI Guillaume <cogoni.guillaume@gmail.com>
Tue, 22 Feb 2022 21:54:29 +0000 (22:54 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 23 Feb 2022 23:08:44 +0000 (15:08 -0800)
commit456296b5d1f05ca16949e7d37ae87f5750118564
tree9a799a0c1724dee01338e8e44cab2c300a921432
parentf01f948282d00b0e22ff08a3acf859fd49bff07c
tests: allow testing if a path is truly a file or a directory

Add test_path_is_file_not_symlink(), test_path_is_dir_not_symlink()
and test_path_is_symlink(). Case of use for the first one
in test t/t3903-stash.sh to replace "test -f" because that function
explicitly want the file not to be a symlink.
Give more friendly error message.

Signed-off-by: COGONI Guillaume <cogoni.guillaume@gmail.com>
Co-authored-by: BRESSAT Jonathan <git.jonathan.bressat@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3903-stash.sh
t/test-lib-functions.sh