git2r icon indicating copy to clipboard operation
git2r copied to clipboard

diff(repository(".")) fails

Open hadley opened this issue 9 years ago • 1 comments

> summary(diff(repository(".")))
Old:  index 
New:  workdir 
No changes.
> system("git diff")
diff --git a/R/git.R b/R/git.R
index 7cb7b6d..38fab7d 100644
--- a/R/git.R
+++ b/R/git.R
@@ -28,8 +28,9 @@ git_sha1 <- function(n = 10, path = ".") {

 uncommitted <- function(path = ".") {
   in_dir(path, system("git diff-index --quiet --cached HEAD") == 1 ||
-    system("git diff-files --quiet") == 1)
+    system("git diff-files --quiet") ==  1)
 }
+# tests


 github_info <- function(pkg = ".") {

Any thoughts on what might cause this problem? The example in git_diff works as expected

hadley avatar Apr 28 '15 20:04 hadley

Wow, I can reproduce this in the devtools tree, but not in other git trees.....

gaborcsardi avatar Apr 28 '15 21:04 gaborcsardi