Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable argument 'all' to commit multiple modified (or deleted) files. #283

Merged
merged 1 commit into from Jun 3, 2017
Merged

Enable argument 'all' to commit multiple modified (or deleted) files. #283

merged 1 commit into from Jun 3, 2017

Conversation

jdblischak
Copy link
Contributor

I observed the behavior that setting the argument all = TRUE for commit only commits one tracked file instead of all tracked files. The unit tests only test for one modified file or one deleted file. I think the issue is from line #155 in commit.r. s$unstaged is a named list, thus passing s$unstaged$modified to lapply is only passing one element of the list. Here's a small example to illustrate:

s <- list(unstaged = list(modified = "file1.txt", modified = "file2.txt"))
lapply(s$unstaged$modified, function(x) x)
## [[1]]
## [1] "file1.txt"

I updated commit so that it will iterate over all tracked files and also added some unit tests. I was able to run make check successfully with R 3.4.0 on Ubuntu 16.10. Please let me know if you would like me to make any modifications.

Signed-off-by: John Blischak <jdblischak@gmail.com>
@coveralls
Copy link

Coverage Status

Coverage increased (+0.008%) to 78.026% when pulling bcc1056 on jdblischak:commit-all into 1a1c392 on ropensci:master.

@stewid stewid merged commit 35469bc into ropensci:master Jun 3, 2017
@stewid
Copy link
Member

stewid commented Jun 3, 2017

Thanks for finding the bug and fixing it, much appreciated.

Cheers
Stefan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants