commit - 6841da0026bfd0be124721da859278eff7353c4f
commit + b80270a75026f6a3e46594ecdd024b6f9e77a368
blob - 61c82088a8a2401eae516229118fdc49eac21432
blob + 58f47bcb9d3d140efc6e5e0e4ddcfc432387e204
--- lib/worktree.c
+++ lib/worktree.c
}
static const struct got_error *
-add_ignores(struct got_pathlist_head *ignores, const char *path)
+add_ignores(struct got_pathlist_head *ignores, const char *root_path,
+ const char *path)
{
const struct got_error *err = NULL;
char *ignorespath;
FILE *ignoresfile = NULL;
/* TODO: read .gitignores as well... */
- if (asprintf(&ignorespath, "%s%s.cvsignore", path, path[0] ? "/" : "")
- == -1)
+ if (asprintf(&ignorespath, "%s/%s%s.cvsignore", root_path, path,
+ path[0] ? "/" : "") == -1)
return got_error_from_errno("asprintf");
ignoresfile = fopen(ignorespath, "r");
}
if (de->d_type == DT_DIR)
- err = add_ignores(&a->ignores, path);
+ err = add_ignores(&a->ignores, a->worktree->root_path, path);
else if (got_path_is_child(path, a->status_path, a->status_path_len)
&& !match_ignores(&a->ignores, path))
err = (*a->status_cb)(a->status_arg, GOT_STATUS_UNVERSIONED,
arg.cancel_cb = cancel_cb;
arg.cancel_arg = cancel_arg;
TAILQ_INIT(&arg.ignores);
- err = add_ignores(&arg.ignores, "");
+ err = add_ignores(&arg.ignores, worktree->root_path, path);
if (err == NULL)
err = got_fileindex_diff_dir(fileindex, workdir,
worktree->root_path, path, repo, &fdiff_cb, &arg);
blob - e4d71a97459fd79e1edfb492c0b395452e70e44a
blob + 99766ac88326608f2b27f3b5c8415b095b11073c
--- regress/cmdline/status.sh
+++ regress/cmdline/status.sh
echo '? epsilon/boo' >> $testroot/stdout.expected
echo '? foop' >> $testroot/stdout.expected
(cd $testroot/wt && got status > $testroot/stdout)
+
+ 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
+ echo '? .cvsignore' > $testroot/stdout.expected
+ echo '? epsilon/.cvsignore' >> $testroot/stdout.expected
+ echo '? epsilon/boo' >> $testroot/stdout.expected
+ echo '? foop' >> $testroot/stdout.expected
+ (cd $testroot/wt/gamma && got status > $testroot/stdout)
+
cmp -s $testroot/stdout.expected $testroot/stdout
ret="$?"
if [ "$ret" != "0" ]; then