commit 54817d72bf743bcd8d0313b5af1bd9899bbda5e9 from: Stefan Sperling date: Sat Jul 27 10:40:05 2019 UTC fix a status bug exposed by test_update_conflict_wt_rm_vs_repo_rm commit - a5edda0a8a1e3910928b815a6c047c58bc732901 commit + 54817d72bf743bcd8d0313b5af1bd9899bbda5e9 blob - 4101d79ebd4fde3380f09ac29feed253aa25c1ec blob + 697a915ed38df21ef42020ebdfebe2dac3ab36a2 --- lib/worktree.c +++ lib/worktree.c @@ -2263,18 +2263,9 @@ worktree_status(struct got_worktree *worktree, const c workdir = opendir(ondisk_path); if (workdir == NULL) { if (errno == ENOTDIR || errno == ENOENT) { - struct got_fileindex_entry *ie; - ie = got_fileindex_entry_get(fileindex, path); - if (ie == NULL) - err = (*status_cb)(status_arg, - GOT_STATUS_UNVERSIONED, path, NULL, NULL); - else - err = report_file_status(ie, ondisk_path, - status_cb, status_arg, repo); - if (err) - goto done; - err = report_file_status(ie, ondisk_path, - status_cb, status_arg, repo); + err = report_file_status( + got_fileindex_entry_get(fileindex, path), + ondisk_path, status_cb, status_arg, repo); goto done; } else { err = got_error_from_errno2("opendir", ondisk_path); blob - ce179b0abdbeedd05c12868f359472f1a1517349 blob + e3be1a78b49b4799aa92d21da6fb2fbf6a85eb6b --- regress/cmdline/update.sh +++ regress/cmdline/update.sh @@ -1052,8 +1052,17 @@ function test_update_conflict_wt_rm_vs_repo_rm { fi # beta is now gone... we don't flag tree conflicts yet - echo 'got: bad path' > $testroot/stderr.expected - (cd $testroot/wt && got status beta 2> $testroot/stderr) + echo -n > $testroot/stdout.expected + echo -n > $testroot/stderr.expected + (cd $testroot/wt && got status beta > $testroot/stdout \ + 2> $testroot/stderr) + cmp -s $testroot/stdout.expected $testroot/stdout + ret="$?" + if [ "$ret" != "0" ]; then + diff -u $testroot/stdout.expected $testroot/stdout + test_done "$testroot" "$ret" + return 1 + fi cmp -s $testroot/stderr.expected $testroot/stderr ret="$?" if [ "$ret" != "0" ]; then