There was an error while loading. Please reload this page.
1 parent 7ae4d9a commit 72e3629Copy full SHA for 72e3629
1 file changed
tests/testthat/test-restore.R
@@ -20,15 +20,19 @@ test_that("git_restore restores from a specific ref", {
20
configure_local_user(repo)
21
22
writeLines("v1", file.path(repo, "hello.txt"))
23
- git_add("hello.txt", repo = repo)
+ writeLines("v1", file.path(repo, "keep.txt"))
24
+
25
+ git_add(c("hello.txt", "keep.txt"), repo = repo)
26
first <- git_commit("First commit", repo = repo)
27
28
writeLines("v2", file.path(repo, "hello.txt"))
29
+ writeLines("v2", file.path(repo, "keep.txt"))
30
31
git_commit("Second commit", repo = repo)
32
33
git_restore("hello.txt", ref = first, repo = repo)
34
expect_equal(readLines(file.path(repo, "hello.txt")), "v1")
35
+ expect_equal(readLines(file.path(repo, "keep.txt")), "v2")
36
})
37
38
test_that("git_restore restores all files with path = '.'", {
0 commit comments