* Separate partitioning from globbing in cmdutil/args package and consumers
In the previous commit, GlobPaths was overloaded, containing logic
specific to command use-cases. This commit removes that functionality from
GlobPaths and back into the commands that have the special use-cases.
To do this, I've introduced a new Partition util in cmdutil/args.go that
will separate a slice into two slices given a predicate. This functionality
is leveraged by both the special use-cases described above to separate the
command-specific syntax from the globable filepaths.
* Add test to validate that the order of '-' in gh gist create args doesn't matter
Enables up to 3 retries of uploading a single asset when encountering a network error or a HTTP 5xx error.
Bonus:
- simplifies ConcurrentUpload implementation
- support Go context cancellation
The `Request.GetBody` func allows the retry mechanism to reopen the file
that's being uploaded as the request body in case the body of the
previous request has already started to be read.
Hopefully fixes the error:
http2: Transport: cannot retry err [stream error: stream ID 1; REFUSED_STREAM]
after Request.Body was written; define Request.GetBody to avoid this error
Ref. d523dce5a7/http2/transport.go (L554)
Currently the mimecap package is an requirement to pass the test suite,
as we need /etc/mime.types to recognize the tar extension. A better idea
is to inline all of the basic test cases for the test suite.
Signed-off-by: Morten Linderud <morten@linderud.pw>