Deleting files via trees no longer works? #24420
-
Based on this comment, I’ve been able to delete multiple files from a repo with the v3 api via:
This used to work fine, but no longer does. It currently responds with “201 Created”, but just contains the parent tree (same sha, and still containing deleted files). Have there been any recent changes to the v3 api that may have caused this? EDIT: this also breaks renaming files via trees |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I just tested it and it worked fine. Here’s what I did:
You can see the final result in the repository. One thing I did notice is that when creating the new tree objects, I needed to leave out the I hope that helps! |
Beta Was this translation helpful? Give feedback.
-
@lee-dohm thanks for the response!
This was the part I had wrong. I was passing the parent commit’s tree sha, but seems like doing so will fill in missing leafs from the base tree. My script definitely previously worked (improperly) with Either way, leaving it out fixed my issue. Thanks! |
Beta Was this translation helpful? Give feedback.
I just tested it and it worked fine. Here’s what I did:
directory
in https://github.com/lee-dohm/test-repo with two filesdelete-this-file.txt
anddo-not-delete-this-file.txt
(see result)directory
that does not containdelete-this-file.txt
/
that points to all the same stuff except points to the new tree object created in step 2 fordirectory
You can see the final result in the repository.
One thing I did notice is that whe…