mirror of
https://github.com/grdl/git-get.git
synced 2026-02-07 19:54:19 +00:00
Add branch checkout helper and test branches being ahead of upstream
This commit is contained in:
@@ -37,10 +37,17 @@ func TestClonedBranches(t *testing.T) {
|
||||
stageFile(t, origin, "file")
|
||||
createCommit(t, origin, "Initial commit")
|
||||
|
||||
createBranch(t, origin, "branch")
|
||||
|
||||
repo, err := CloneRepo(origin.Path(), newTempDir(t))
|
||||
checkFatal(t, err)
|
||||
|
||||
createBranch(t, repo, "branch")
|
||||
createBranch(t, repo, "local")
|
||||
|
||||
checkoutBranch(t, repo, "branch")
|
||||
createFile(t, repo, "anotherFile")
|
||||
stageFile(t, repo, "anotherFile")
|
||||
createCommit(t, repo, "Second commit")
|
||||
|
||||
branches, err := Branches(repo)
|
||||
checkFatal(t, err)
|
||||
@@ -62,6 +69,18 @@ func TestClonedBranches(t *testing.T) {
|
||||
{branches["branch"], BranchStatus{
|
||||
Name: "branch",
|
||||
IsRemote: false,
|
||||
HasUpstream: true,
|
||||
Ahead: 1,
|
||||
NeedsPush: true,
|
||||
}},
|
||||
{branches["origin/branch"], BranchStatus{
|
||||
Name: "origin/branch",
|
||||
IsRemote: true,
|
||||
HasUpstream: false,
|
||||
}},
|
||||
{branches["local"], BranchStatus{
|
||||
Name: "local",
|
||||
IsRemote: false,
|
||||
HasUpstream: false,
|
||||
}},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user