Permalink
Browse files

Add a test showing that git_status_file gets confused by spaces in .g…

…itignore
  • Loading branch information...
1 parent e0b110e commit cfc17dc41b1ce251d72696b4168b3d6d77fc54ab @aroben aroben committed Jun 9, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 tests-clar/status/ignore.c
@@ -131,3 +131,17 @@ void test_status_ignore__empty_repo_with_gitignore_rewrite(void)
cl_assert(ignored);
}
+void test_status_ignore__ignore_pattern_contains_space(void)
+{
+ unsigned int flags;
+ const mode_t mode = 0777;
+
+ g_repo = cl_git_sandbox_init("empty_standard_repo");
+ cl_git_rewritefile("empty_standard_repo/.gitignore", "foo bar.txt\n");
+
+ cl_git_pass(git_futils_mkdir_r("empty_standard_repo/foo", NULL, mode));
+ cl_git_mkfile("empty_standard_repo/foo/look-ma.txt", "I'm not going to be ignored!");
+
+ cl_git_pass(git_status_file(&flags, g_repo, "foo/look-ma.txt"));
+ cl_assert(flags == GIT_STATUS_WT_NEW);
+}

0 comments on commit cfc17dc

Please sign in to comment.