Commit 95818ff73aa8af414c4c893a5088656ac07a6de4

nulltoken 2011-06-08T22:15:49

Fix filebuf0 test which was failing on Windows

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/tests/t00-core.c b/tests/t00-core.c
index 5cd4025..1358cc6 100644
--- a/tests/t00-core.c
+++ b/tests/t00-core.c
@@ -664,9 +664,12 @@ END_TEST
 
 BEGIN_TEST(filebuf0, "make sure git_filebuf_open doesn't delete an existing lock")
 	git_filebuf file;
+	int fd;
 	char test[] = "test", testlock[] = "test.lock";
 
-	must_pass(gitfo_creat(testlock, 0744));
+	fd = gitfo_creat(testlock, 0744);
+	must_pass(fd);
+	must_pass(gitfo_close(fd));
 	must_fail(git_filebuf_open(&file, test, 0));
 	must_pass(gitfo_exists(testlock));
 	must_pass(gitfo_unlink(testlock));