You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This command creates an empty Git repository - basically a .git directory with subdirectories for objects, refs/heads, refs/tags, and template files. An initial branch without any commits will be created (see the --initial-branch option below for its name).
However, Rugged::Repository.init_at does not create any branches:
require'rugged'require'tmpdir'Dir.mktmpdirdo |temp_dir| # This directory will be deleted on exitDir.chdir(temp_dir)puts"Working in #{temp_dir}"repo=Rugged::Repository.init_attemp_dir`git branch -l`# no output and no errorrepo.checkout'master'# Throws Rugged::ReferenceError: revspec 'master' not foundend
Is this a bug?
Also, attempting to create a branch after calling init_at fails:
repo=Rugged::Repository.init_attemp_dirrepo.create_branch'master'# Throws Rugged::ReferenceError: revspec 'HEAD' not found
However, attempting to create the branch using the command line after calling init_at works:
Rugged::Repository.init_attemp_dir`git checkout -b master`# works just fine
The text was updated successfully, but these errors were encountered:
However, Rugged::Repository.init_at does not create any branches:
This is true! If you want a branch, make a commit to the default branch, then create the branch.
To configure the initial branch name for use in all new repositories, set the init.defaultBranch global git configuration value. For example, to set master as the initial branch name, type:
The
git-init
docs say:However,
Rugged::Repository.init_at
does not create any branches:Is this a bug?
Also, attempting to create a branch after calling
init_at
fails:However, attempting to create the branch using the command line after calling
init_at
works:The text was updated successfully, but these errors were encountered: