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

Fails to verify if branch exists or not & then fails to push because branch exists on remote. #42

Closed
TheBlackPlague opened this issue Mar 5, 2022 · 3 comments

Comments

@TheBlackPlague
Copy link

TheBlackPlague commented Mar 5, 2022

Environment: This is run inside a docker container.

It seems the action fails to verify if a branch exists or not:

/usr/bin/git fetch
/usr/bin/git rev-parse --verify project-tree
fatal: Needed a single revision
Branch project-tree does not yet exist, creating project-tree.
/usr/bin/git checkout -b project-tree
Switched to a new branch 'project-tree'

In the above case, it says that project-tree doesn't exist, when it exists on remote. Furthermore, this matters because it later fails to push as the branch already exists on remote and the local history isn't updated:

[project-tree REDACTED] Update Project Tree (REDACTED).
   1 file changed, 1 insertion(+)
   create mode 100644 diagram.svg
  /usr/bin/git push --set-upstream origin project-tree
  To REDACTED
   ! [rejected]        project-tree -> project-tree (non-fast-forward)
  error: failed to push some refs to 'REDACTED'
  hint: Updates were rejected because the tip of your current branch is behind
  hint: its remote counterpart. Integrate the remote changes (e.g.
  hint: 'git pull ...') before pushing again.
  hint: See the 'Note about fast-forwards' in 'git push --help' for details.
@pohy
Copy link

pohy commented Jul 3, 2022

Hi, I have submitted a fix PR.
Until it is accepted you can use my fork uses: pohy/repo-visualizer@main

@TheBlackPlague
Copy link
Author

Thank you very much @pohy!

@Wattenberger
Copy link
Contributor

this should be fixed - please shout if you're still seeing this behavior. sorry about the delay!

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

Successfully merging a pull request may close this issue.

3 participants