Skip to content

Commit

Permalink
fix tests after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
azr committed Jan 28, 2020
1 parent 1a103f2 commit dcd05df
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 14 deletions.
8 changes: 2 additions & 6 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,8 @@ func (c *Client) Get(ctx context.Context, req *Request) (*Operation, error) {
}

// Store this locally since there are cases we swap this
if req.Mode == ClientModeInvalid {
if req.Dir {
req.Mode = ClientModeDir
} else {
req.Mode = ClientModeFile
}
if req.Mode == ModeInvalid {
req.Mode = ModeAny
}

var err error
Expand Down
2 changes: 0 additions & 2 deletions client_option_progress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ func TestGet_progress(t *testing.T) {
Dst: dst,
Src: s.URL + "/file?thig=this&that",
ProgressListener: p,
Dir: false,
}
if _, err := DefaultClient.Get(ctx, req); err != nil {
t.Fatalf("download failed: %v", err)
Expand All @@ -63,7 +62,6 @@ func TestGet_progress(t *testing.T) {
Dst: dst,
Src: s.URL + "/otherfile?thig=this&that",
ProgressListener: p,
Dir: false,
}
if _, err := DefaultClient.Get(ctx, req); err != nil {
t.Fatalf("download failed: %v", err)
Expand Down
2 changes: 1 addition & 1 deletion get_git.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type GitGetter struct {

var defaultBranchRegexp = regexp.MustCompile(`\s->\sorigin/(.*)`)

func (g *GitGetter) ClientMode(_ context.Context, u *url.URL) (ClientMode, error) {
func (g *GitGetter) Mode(_ context.Context, u *url.URL) (Mode, error) {
return ModeDir, nil
}

Expand Down
6 changes: 3 additions & 3 deletions get_git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ func TestGitGetter_sshSCPStyle(t *testing.T) {
Dst: dst,
Pwd: ".",

Mode: ClientModeDir,
Mode: ModeDir,
}
client := &Client{
Detectors: []Detector{
Expand Down Expand Up @@ -452,7 +452,7 @@ func TestGitGetter_sshExplicitPort(t *testing.T) {
Dst: dst,
Pwd: ".",

Mode: ClientModeDir,
Mode: ModeDir,
}
client := &Client{

Expand Down Expand Up @@ -496,7 +496,7 @@ func TestGitGetter_sshSCPStyleInvalidScheme(t *testing.T) {
Dst: dst,
Pwd: ".",

Mode: ClientModeDir,
Mode: ModeDir,
}

client := &Client{
Expand Down
3 changes: 1 addition & 2 deletions get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -753,8 +753,7 @@ func TestGetFile_inplace_badChecksum(t *testing.T) {
if err == nil {
t.Fatalf("err is nil")
}
_, ok := err.(*ChecksumError)
if ok == false {
if _, ok := err.(*ChecksumError); !ok {
t.Fatalf("err is not a checksum error: %v", err)
}
if op != nil {
Expand Down

0 comments on commit dcd05df

Please sign in to comment.