Skip to content
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

Captain push -Bc fails when on a tag #85

Open
jwliechty opened this issue May 17, 2019 · 0 comments
Open

Captain push -Bc fails when on a tag #85

jwliechty opened this issue May 17, 2019 · 0 comments

Comments

@jwliechty
Copy link
Contributor

If on a tag of a git repository (for instance v3.0 and doing a captain push -Bc, there is an error where captain tries to create a docker tag with the name (HEAD detached at v3.0). This is because the getBranches function uses the following command to get all the branch names.

git branch --no-column --contains HEAD

Which gives the output (on my system)

* (HEAD detached at v3.0)
  b-four
  b-one
  b-three
  b-two
  master

The other interesting thing is that it uses the --contains flag. Instead, I think this should be the --points-at. If pushing up docker contains for tagged with branches, wouldn't you want to do so only for those branches whose HEAD is the same as what you currently have checked out? As it stands, the --contains will grab any branch that has the HEAD commit. This means that if on master and pushing with -B, master and develop will get tagged and pushed up even if develop is ahead of master in commits.

I have a pull request which addresses both of these concerns with tests!

Please review and accept!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant