git2r
git2r copied to clipboard
`merge()` overwrites `base::merge()`
I'm raising this issue off the back of this Stack Overflow question, and I've included the reproducible example used in that question.
See the offending line of code here
merge() seems to overwrite the meaning of the base::merge function. This breaks the below code:
d1 <- c("a", "b")
d2 <- c(1,2)
merge(d1,d2) # This works
# Any call to any git2r function will break the code
git2r::config()
# This does not work anymore.
merge(d1,d2)
base::merge(d1,d2)
The error is:
Error in discover_repository(path) :
Error in 'git2r_repository_discover': 'path' must be a character vector of length one with non NA value
In addition: Warning messages:
1: In normalizePath(path) : path[1]="a": No such file or directory
2: In normalizePath(path) : path[2]="b": No such file or directory
> traceback()
5: discover_repository(path)
4: repository(repo)
3: lookup_repository(x)
2: merge.character(d1, d2)
1: base::merge(d1, d2)
What astonishes me is that explicitly specifying base::merge does not solve the issue.
It is probably because the git2r::merge function is part of the base namespace, instead of the git2r namespace:
git2r::merge
function (x, y, ...)
UseMethod("merge")
<bytecode: 0x557184940ee0>
<environment: namespace:base>