repo-visualizer icon indicating copy to clipboard operation
repo-visualizer copied to clipboard

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

Open TheBlackPlague opened this issue 2 years ago • 2 comments

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.

TheBlackPlague avatar Mar 05 '22 01:03 TheBlackPlague

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

pohy avatar Jul 03 '22 13:07 pohy

Thank you very much @pohy!

TheBlackPlague avatar Jul 07 '22 11:07 TheBlackPlague

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

Wattenberger avatar Sep 13 '22 16:09 Wattenberger