Commit Graph

29 Commits

Author SHA1 Message Date
brian m. carlson
1412d6e47a
Don't fail if we lack objects the server has
A Git LFS client may not have the entire history of the objects for the
repository. However, in some situations, we traverse the entire history
of a branch when pushing it, meaning that we need to process every
LFS object in the history of that branch. If the objects for the entire
history are not present, we currently fail to push.

Instead, let's mark objects we don't have on disk as missing and only
fail when we would need to upload those objects. We'll know the server
has the objects if the batch response provides no actions to take for
them when we request an upload. Pass the missing flag down through the
code, and always set it to false for non-uploads.

If for some reason we fail to properly flag a missing object, we will
still fail later on when we cannot open the file, just in a messier and
more poorly controlled way. The technique used here will attempt to
abort the batch as soon as we notice a problem, which means that in the
common case (less than 100 objects) we won't have transferred any
objects, so the user can notice the failure as soon as possible.

Update the tests to look for a string which will occur in the error
message, since we no longer produce the system error message for ENOENT.
2019-07-15 20:47:04 +00:00
Taylor Blau
aa2ad1243d tq/transfer.go: add Checkout direction 2018-06-08 15:47:52 -05:00
Taylor Blau
12dc6dd88b tq/meter: introduce tq.Direction.Verb 2018-06-08 15:47:52 -05:00
Taylor Blau
19d7ebe540 tq: remove JSON tag for un-exported field 2017-12-14 21:06:47 -05:00
Taylor Blau
0d66374f4f tq,lfsapi/ssh: include createdAt field in struct 2017-04-05 16:43:00 -06:00
Taylor Blau
804a91dbd6 tq,lfsapi/ssh: convert int64 to int 2017-04-05 14:46:45 -06:00
Taylor Blau
b65800a06d tq,lfsapi/auth: change expires_in to be a whole number of seconds 2017-04-05 14:32:37 -06:00
Taylor Blau
425d03d48a tq,docs,test: add expires_in support to batch API 2017-04-05 14:00:55 -06:00
Taylor Blau
3180a2d0b8 tq: use Rel() function to implement multiActionSet 2017-03-06 14:33:58 -07:00
Taylor Blau
5581c1b805 tq: implement 'HybridActions()' 2017-03-06 13:10:33 -07:00
Taylor Blau
70b1311e3d tq: implement 'multiActionSet' 2017-03-06 13:10:06 -07:00
Taylor Blau
1adf3bc378 tq: implement "_links" field 2017-03-06 13:09:10 -07:00
Taylor Blau
ad8916f686 tq: promote ActionSet to interface 2017-03-06 12:41:40 -07:00
Taylor Blau
d15c7ea989 tq: remove usage of ActionMissingErr 2017-03-06 12:36:21 -07:00
risk danger olson
7c02e2217c tq: revert Direction back to int, add String() conversion func 2017-01-09 12:52:36 -07:00
risk danger olson
924befe2f0 tq,test: export func for calling Batch API directly 2017-01-06 20:13:31 -07:00
risk danger olson
90878099b2 tq: remove objectResource in favor of Transfer 2017-01-06 15:51:49 -07:00
risk danger olson
3d68f16f03 tq: move api.ObjectResource to tq pkg 2017-01-06 15:38:04 -07:00
risk danger olson
3d72a371e8 tq: teach basic adapter to use lfsapi.Client 2017-01-04 15:22:31 -07:00
risk danger olson
2b20d510cc tq: remove remote/operation/access from tq.Manifest, make remote an arg of NewTransferQueue() 2017-01-04 14:46:30 -07:00
Taylor Blau
6bb72470d0 Merge pull request #1777 from git-lfs/tq-unexport
tq: un-export `NewTransfer` and `Batch`
2016-12-15 14:24:10 -07:00
Taylor Blau
a0b1adf436 tq: un-export tq.NewTransfer 2016-12-15 14:02:34 -07:00
risk danger olson
303156e0e2 Change Adapter Begin() signature to accept an AdapterConfig interface 2016-12-15 09:59:06 -07:00
Taylor Blau
5fc2344e6a tq: move object.go into transfer.go 2016-12-14 15:22:30 -07:00
Taylor Blau
e18044f38b tq: use *tq.Transfer instead of Transferable and transfer.Transfer 2016-12-14 15:03:09 -07:00
Taylor Blau
886dbcc5c9 lfs,tq: 🔥 completionChan from the tq API 2016-12-12 09:24:11 -07:00
Taylor Blau
77312ebda5 tq: remove "Transfer" prefix from "TransferAdapterFunc" and others 2016-12-12 09:24:10 -07:00
Taylor Blau
240ca02f6a lfs,tq: rename tq.TransferProgressCallback to tq.ProgressCallback 2016-12-12 09:24:10 -07:00
Taylor Blau
891db97a42 tq,transfer: move pkg "transfer" to "tq" 2016-12-12 09:24:10 -07:00