create new action: git switch (#798)

* create new action: git switch

If the branch already exists in local, switch to that.
If the branch is only in remote, create new branch tracking remote and switch to new one.

* fix a point of review

* fix a point of review: map to git-switch action

* Revert "fix a point of review"

This reverts commit 017ce424a3adfe1b3712a421385cfc3f4258a0fb.

* undocument header comment
This commit is contained in:
Kyoichiro Yamada
2021-05-11 17:55:41 +09:00
committed by GitHub
parent 9fd242db26
commit d5aa53dcd3
2 changed files with 29 additions and 1 deletions

View File

@@ -199,9 +199,11 @@ git.branches = function(opts)
map('i', '<c-a>', actions.git_create_branch)
map('n', '<c-a>', actions.git_create_branch)
map('i', '<c-s>', actions.git_switch_branch)
map('n', '<c-s>', actions.git_switch_branch)
map('i', '<c-d>', actions.git_delete_branch)
map('n', '<c-d>', actions.git_delete_branch)
return true
end
}):find()