git-resource icon indicating copy to clipboard operation
git-resource copied to clipboard

branch parameter allows passing additional flag to git clone

Open micw-dec opened this issue 5 years ago • 1 comments

While experimenting with different branches from a git repository we noticed that it's possible to pass an additional flag to git clone via the branch parameter in the source configuration, for example:

resources:
  - name: some-repo
    type: git
    source:
      uri: some-uri
      branch: some-branch --no-single-branch

In that case the --single-branch option passed to git clone in the in-script is overridden, it looks like the branch-parameter is not checked before passing it on.

Maybe one possible solution could be to split the parameter on space and ignore the rest (or exit with an error code?).

micw-dec avatar Jun 22 '20 09:06 micw-dec

I would actually like to vote against this being impemented. This undocumented feature is a life saver for our team to be able to perform a git diff between different branches in the same repo

jforand avatar Oct 05 '21 17:10 jforand