Skip to content

Commit

Permalink
fix mrBrowseCurrent test
Browse files Browse the repository at this point in the history
  • Loading branch information
zaquestion committed Oct 18, 2018
1 parent 9c3caf4 commit e92a944
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cmd/mr_browse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,20 @@ func Test_mrBrowseWithParameter(t *testing.T) {
}

func Test_mrBrowseCurrent(t *testing.T) {
t.Parallel()
repo := copyTestRepo(t)
git := exec.Command("git", "checkout", "mrtest")
git.Dir = repo
b, err := git.CombinedOutput()
if err != nil {
t.Log(string(b))
t.Fatal(err)
}
defer func() {
git := exec.Command("git", "checkout", "master")
b, err := git.CombinedOutput()
if err != nil {
t.Log(string(b))
t.Fatal(err)
}
}()

oldBrowse := browse
defer func() { browse = oldBrowse }()
Expand Down
Binary file modified testdata/test.git/index
Binary file not shown.
3 changes: 3 additions & 0 deletions testdata/test.git/logs/HEAD
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ cd64a7caea4f3ee5696a190379aff1a7f636e598 09b519cba018b707c98fc56e37df15806d89d86
09b519cba018b707c98fc56e37df15806d89d866 cd64a7caea4f3ee5696a190379aff1a7f636e598 Zaq? Wiedmann <zaquestion@gmail.com> 1523752015 -0700 checkout: moving from 09b519cba018b707c98fc56e37df15806d89d866 to master
cd64a7caea4f3ee5696a190379aff1a7f636e598 09b519cba018b707c98fc56e37df15806d89d866 Zaq? Wiedmann <zaquestion@gmail.com> 1523752101 -0700 checkout: moving from master to origin/master
09b519cba018b707c98fc56e37df15806d89d866 09b519cba018b707c98fc56e37df15806d89d866 Zaq? Wiedmann <zaquestion@gmail.com> 1523752116 -0700 checkout: moving from 09b519cba018b707c98fc56e37df15806d89d866 to master
09b519cba018b707c98fc56e37df15806d89d866 54fd49a2ac60aeeef5ddc75efecd49f85f7ba9b0 Zaq? Wiedmann <zaquestion@gmail.com> 1539880912 -0700 checkout: moving from master to mrtest
54fd49a2ac60aeeef5ddc75efecd49f85f7ba9b0 54fd49a2ac60aeeef5ddc75efecd49f85f7ba9b0 Zaq? Wiedmann <zaquestion@gmail.com> 1539881024 -0700 checkout: moving from mrtest to mrtest
54fd49a2ac60aeeef5ddc75efecd49f85f7ba9b0 09b519cba018b707c98fc56e37df15806d89d866 Zaq? Wiedmann <zaquestion@gmail.com> 1539881025 -0700 checkout: moving from mrtest to master

0 comments on commit e92a944

Please sign in to comment.