commit 2c201a36298b33cae3e3f1e94d7f30c20ac8d140 from: Stefan Sperling date: Sun Feb 10 15:41:44 2019 UTC make 'got status' ignore symlinks, for now commit - 18831e78bad91827323e1c4ee3401a275fdccc6c commit + 2c201a36298b33cae3e3f1e94d7f30c20ac8d140 blob - cd4a5481e56acd9f196b92b88730da480595c7bc blob + 9a55298bbc84d3449a19d3cb40e0b87307690de7 --- lib/worktree.c +++ lib/worktree.c @@ -1210,6 +1210,10 @@ status_new(void *arg, struct dirent *de, const char *p char *path = NULL; if (de->d_type == DT_DIR) + return NULL; + + /* XXX ignore symlinks for now */ + if (de->d_type == DT_LNK) return NULL; if (parent_path[0]) { blob - e1df9d426835091efc775cdcf46821e1730d8c96 blob + da1fdaef160970e7af9e50319de23d9026bce53a --- regress/cmdline/status.sh +++ regress/cmdline/status.sh @@ -250,9 +250,40 @@ function test_status_unversioned_subdirs { test_done "$testroot" "$ret" } +# 'got status' ignores symlinks at present; this might change eventually +function test_status_ignores_symlink { + local testroot=`test_init status_ignores_symlink 1` + + mkdir $testroot/repo/ramdisk/ + touch $testroot/repo/ramdisk/Makefile + (cd $testroot/repo && git add .) + git_commit $testroot/repo -m "first commit" + + got checkout $testroot/repo $testroot/wt > /dev/null + ret="$?" + if [ "$ret" != "0" ]; then + test_done "$testroot" "$ret" + return 1 + fi + + ln -s /usr/obj/distrib/i386/ramdisk $testroot/wt/ramdisk/obj + + echo -n > $testroot/stdout.expected + + (cd $testroot/wt && got status > $testroot/stdout) + + cmp $testroot/stdout.expected $testroot/stdout + ret="$?" + if [ "$ret" != "0" ]; then + diff -u $testroot/stdout.expected $testroot/stdout + fi + test_done "$testroot" "$ret" +} + run_test test_status_basic run_test test_status_subdir_no_mods run_test test_status_subdir_no_mods2 run_test test_status_obstructed run_test test_status_shows_local_mods_after_update run_test test_status_unversioned_subdirs +run_test test_status_ignores_symlink