For a given repository, I would like to update a specific submodule to a specific SHA.
In command line, I am able to do this using the command
git submodule update --remote MySubModule
And then push it. It updates it to the latest SHA.
I would like to do the same (update and push) through the Stash API (with a hook of some kind, using a service), but with a specific SHA, not necessarily the latest.
I tried searching in the Stash API, but did not find what I wanted. Is this even possible?
Community moderators have prevented the ability to post new answers.
I wanted to do a very similar thing in a plugin once but ended up abandoning it. There is no way to do this with the Stash API. More precisely, you need to invoke Git from the Stash API, (shallow) clone the repo somewhere and push a commit containing the submodule change.
Do you know how to create that shallow clone and run raw Git commands from the Stash API?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you need to create a Command object with https://developer.atlassian.com/static/javadoc/stash/latest/api/reference/com/atlassian/stash/scm/ScmCommandBuilder.html and then call it. (This applies to all raw Git commands.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.