You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
evaluates to origin (as it must do so commonly). The subsequent line will attempt to transform the full remote branch name (remote name + branch name) into just the branch name. If you have a branch name which starts with any combination of the characters o,r,i,g,n, then lstrip() can potentially strip those characters away as well.
For example, given remote_name = origin, and rev_parse_output = origin/games, "origin/games".lstrip("origin/") will evaluate to "ames", causing the wrong branch to be pushed. This bug should be fairly easy to reproduce.
There is a bug in the
get_upstream_branch()
function concerning the usage oflstrip()
on line 1107jupyterlab-git/jupyterlab_git/git.py
Line 1107 in 0e1e697
Say that line 1106
jupyterlab-git/jupyterlab_git/git.py
Line 1106 in 0e1e697
origin
(as it must do so commonly). The subsequent line will attempt to transform the full remote branch name (remote name + branch name) into just the branch name. If you have a branch name which starts with any combination of the characterso,r,i,g,n
, thenlstrip()
can potentially strip those characters away as well.For example, given
remote_name
=origin
, andrev_parse_output
=origin/games
,"origin/games".lstrip("origin/")
will evaluate to"ames"
, causing the wrong branch to be pushed. This bug should be fairly easy to reproduce.EDIT: Opened #849 for fix
The text was updated successfully, but these errors were encountered: