mirror of
https://github.com/grdl/git-get.git
synced 2026-02-05 11:23:48 +00:00
28 lines
550 B
Go
28 lines
550 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
func TestNewBranch(t *testing.T) {
|
|
repo := newTestRepo(t)
|
|
|
|
createFile(t, repo, "file")
|
|
stageFile(t, repo, "file")
|
|
createCommit(t, repo, "Initial commit")
|
|
branch := createBranch(t, repo, "branch")
|
|
|
|
status, err := NewBranchStatus(branch)
|
|
checkFatal(t, errors.Wrap(err, "Failed getting branch status"))
|
|
|
|
if status.Name != "branch" {
|
|
t.Errorf("Wrong branch name, got %s; want %s", status.Name, "branch")
|
|
}
|
|
|
|
if status.IsRemote != false {
|
|
t.Errorf("Branch should be local")
|
|
}
|
|
}
|