Download raw body.
fix got status <obstructed file>
Omar noticed that 'got status' does not return any result when
called on an obstructed path directly. This patch fixes the issue.
ok?
diff 3ec75771fbdfdc7734da32b81e5cd7266730e60d c0c2b3d1e2c80fe9ee36670cff033f948cca9fd6
blob - 0b4571401cfdddef043be11cce960c58beae2802
blob + 26ce9d0c775728d7d4b6a3450c3704c51f29672a
--- lib/worktree.c
+++ lib/worktree.c
@@ -3645,6 +3645,7 @@ worktree_status(struct got_worktree *worktree, const c
struct diff_dir_cb_arg arg;
char *ondisk_path = NULL;
struct got_pathlist_head ignores;
+ struct got_fileindex_entry *ie;
TAILQ_INIT(&ignores);
@@ -3652,6 +3653,14 @@ worktree_status(struct got_worktree *worktree, const c
worktree->root_path, path[0] ? "/" : "", path) == -1)
return got_error_from_errno("asprintf");
+ ie = got_fileindex_entry_get(fileindex, path, strlen(path));
+ if (ie) {
+ err = report_single_file_status(path, ondisk_path,
+ fileindex, status_cb, status_arg, repo,
+ report_unchanged, &ignores, no_ignores);
+ goto done;
+ }
+
fd = open(ondisk_path, O_RDONLY | O_NOFOLLOW | O_DIRECTORY | O_CLOEXEC);
if (fd == -1) {
if (errno != ENOTDIR && errno != ENOENT && errno != EACCES &&
blob - 9e581724fe4e03c1b4d098200691d364a658da87
blob + f96cb55c8433319268b0b22d1615907b94f37ce7
--- regress/cmdline/status.sh
+++ regress/cmdline/status.sh
@@ -152,7 +152,17 @@ test_status_obstructed() {
ret="$?"
if [ "$ret" != "0" ]; then
diff -u $testroot/stdout.expected $testroot/stdout
+ test_done "$testroot" "$ret"
+ return 1
fi
+
+ (cd $testroot/wt && got status epsilon/zeta > $testroot/stdout)
+
+ cmp -s $testroot/stdout.expected $testroot/stdout
+ ret="$?"
+ if [ "$ret" != "0" ]; then
+ diff -u $testroot/stdout.expected $testroot/stdout
+ fi
test_done "$testroot" "$ret"
}
fix got status <obstructed file>