@@ -32,20 +32,21 @@ populate_init <- function(repo_registry,
32
32
# Error in 'git2r_clone': Unable to authenticate with supplied credentials
33
33
}
34
34
35
+ # # commenting out; not sure we need this anymore if we be sure it's created
35
36
# # get remote branches
36
- remote_branches <- sapply(git2r :: branches(repo , ' remote' ), function (x ) stringr :: str_split(x @ name , ' /' )[[1 ]][2 ])
37
+ # remote_branches <- sapply(git2r::branches(repo, 'remote'), function(x) stringr::str_split(x@name, '/')[[1]][2])
37
38
# # try one day with purrr
38
39
39
40
# # initialize repo
40
- if (length(remote_branches )== 0 ){
41
- system(' touch README.md' )
42
- system(' git add -A; git commit -m "first commit"' )
43
- try(system(' git remote rm origin' )) # stackoverflow.com/questions/1221840/remote-origin-already-exists-on-git-push-to-new-repository
44
- system(sprintf(' git remote add origin https://github.com/OHI-Science/%s.git' , key ))
45
- system(' git push -u origin master' )
46
- system(' git pull' )
47
- remote_branches = sapply(branches(repo , ' remote' ), function (x ) str_split(x @ name , ' /' )[[1 ]][2 ])
48
- }
41
+ # if (length(remote_branches)==0){
42
+ # system('touch README.md')
43
+ # system('git add -A; git commit -m "first commit"')
44
+ # try(system('git remote rm origin')) # stackoverflow.com/questions/1221840/remote-origin-already-exists-on-git-push-to-new-repository
45
+ # system(sprintf('git remote add origin https://github.com/OHI-Science/%s.git', key))
46
+ # system('git push -u origin master')
47
+ # system('git pull')
48
+ # remote_branches = sapply(branches(repo, 'remote'), function(x) str_split(x@name, '/')[[1]][2])
49
+ # }
49
50
50
51
# # recreate empty dir, except hidden .git (all.files=FALSE)
51
52
for (f in list.files(dir_repo , all.files = FALSE )) {
@@ -71,6 +72,7 @@ populate_init <- function(repo_registry,
71
72
cat(sprintf(" git add, commit, and push %s repo" , key ))
72
73
system(sprintf(' cd %s; git add -A; git commit -a -m "%s repo populated with initial files"' , dir_repo , key ))
73
74
system(sprintf(' cd %s; git push origin master' , dir_repo ))
75
+
74
76
}
75
77
76
78
return (repo )
0 commit comments