-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
WIP: Add commit sha to filepath api #13599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -62,6 +62,7 @@ func getExpectedFileResponseForCreate(commitID, treePath string) *api.FileRespon | |||
SHA: sha, | |||
Size: 16, | |||
Type: "file", | |||
Commit: CommitID, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be?
Commit: CommitID, | |
Commit: commitID, |
This looks OK to me. Just would like you to confirm that this matches the github api. It appears that this does not match the Github API. So I think we need to be very careful here. This is potentially quite slow to generate. |
@@ -146,13 +146,19 @@ func GetContents(repo *models.Repository, treePath, ref string, forList bool) (* | |||
} | |||
selfURLString := selfURL.String() | |||
|
|||
lastCommit, err := commit.GetCommitByPath(treePath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be quite slow depending on the version of git present and the size of the repository.
Internally this code may need to be tied in to the last commit cache.
Would you prefer that approach? |
in general, I think we would better return 'lastcommit' rather than commit, as this is not obvious very obvious in some cases. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions. |
This is in progress for a while now, I'm closing it to avoid stale pull requests. Please reopen when it's ready for review. |
This is an attempt to give a solution to #12840
I'm not really satisfied with the tests yet, as the repo that is used in the test has only one commit, it's not really possible to check that the returned commit is correct.