Permalink
Browse files

gitR: fixing crash in case of ignored directory (using git 1.7.6.5).

  • Loading branch information...
1 parent df3f300 commit c1fe794a51053d60bb804fb8bfe34d6efa2643e0 Manuel Koller committed Apr 5, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 gitR-package/R/methods.R
@@ -124,6 +124,7 @@ gitStatus <- function(dir=getwd(),
untracked = c("all", "no", "normal"),
ignoreSubmodules = c("none", "untracked", "dirty", "all"),
ignored = FALSE) {
+ if (dir == "./") dir <- getwd()
## get toplevel directory (show only subdirectory if dir is not tl)
tl <- gitToplevel(dir)
## convert dir into an absolute path
@@ -140,7 +141,7 @@ gitStatus <- function(dir=getwd(),
status <- gitSystem(args, dir)
## filter
if (nchar(rdir) > 0) {
- filter <- sprintf("( |\")%s/", rdir)
+ filter <- sprintf("( |\")%s/.+", rdir)
status <- grep(filter, status, value=TRUE)
status <- gsub(filter, "\\1", status)
}

0 comments on commit c1fe794

Please sign in to comment.