Skip to content

Commit 14a4e9a

Browse files
authored
Merge pull request #518 from kgryte/refactor-branch-dropdown
Refactor branch menu
2 parents 576c444 + f75c2a6 commit 14a4e9a

36 files changed

+3036
-1060
lines changed

jupyterlab_git/git.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -606,12 +606,13 @@ def reset_to_commit(self, commit_id, top_repo_path):
606606
)
607607
return my_output
608608

609-
def checkout_new_branch(self, branchname, current_path):
609+
def checkout_new_branch(self, branchname, startpoint, current_path):
610610
"""
611611
Execute git checkout <make-branch> command & return the result.
612612
"""
613+
cmd = ["git", "checkout", "-b", branchname, startpoint]
613614
p = Popen(
614-
["git", "checkout", "-b", branchname],
615+
cmd,
615616
stdout=PIPE,
616617
stderr=PIPE,
617618
cwd=os.path.join(self.root_dir, current_path),

jupyterlab_git/handlers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def post(self):
320320
if data["checkout_branch"]:
321321
if data["new_check"]:
322322
my_output = self.git.checkout_new_branch(
323-
data["branchname"], top_repo_path
323+
data["branchname"], data["startpoint"], top_repo_path
324324
)
325325
else:
326326
my_output = self.git.checkout_branch(data["branchname"], top_repo_path)

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
"@jupyterlab/services": "^4.1.0",
5959
"@jupyterlab/terminal": "^1.1.0",
6060
"@jupyterlab/ui-components": "^1.1.0",
61+
"@material-ui/core": "^4.8.2",
62+
"@material-ui/icons": "^4.5.1",
6163
"@phosphor/widgets": "^1.8.0",
6264
"diff-match-patch": "^1.0.4",
6365
"nbdime": "~5.0.1",

src/components/BranchHeader.tsx

-213
This file was deleted.

0 commit comments

Comments
 (0)