As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Unverified Commit d4490feb authored by Joseph Snyder's avatar Joseph Snyder Committed by Ash McKenzie
Browse files

Account for empty ref objects

If an empty string is passed as the ref, return nothing and an error
stating that it should be filled.
parent 6b5c1f83
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -3,6 +3,7 @@ package lfstransfer
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"net/http"
"time"
Loading
Loading
@@ -56,10 +57,11 @@ func NewClient(config *config.Config, args *commandargs.Shell, href string, auth
func (c *Client) Batch(operation string, reqObjects []*BatchObject, ref string, reqHashAlgo string) (*BatchResponse, error) {
var bref *batchRef
if ref != "" {
bref = &batchRef{Name: ref}
if ref == "" {
return nil, errors.New("A ref must be specified.")
}
bref = &batchRef{Name: ref}
body := batchRequest{
Operation: operation,
Objects: reqObjects,
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment