File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Original file line number Diff line number Diff line change @@ -2959,9 +2959,15 @@ def save(
2959
2959
GitBranchCommandLiteral = Literal [
2960
2960
"create" , # checkout -b
2961
2961
"checkout" , # checkout
2962
+ "_list" ,
2962
2963
"move" , # branch -m, or branch -M with force
2963
2964
"copy" , # branch -c, or branch -C with force
2964
2965
"delete" , # branch -d, or branch -D /ith force
2966
+ "set_upstream" ,
2967
+ "unset_upstream" ,
2968
+ "track" ,
2969
+ "no_track" ,
2970
+ "edit_description" ,
2965
2971
]
2966
2972
2967
2973
@@ -3035,3 +3041,35 @@ def run(
3035
3041
check_returncode = check_returncode ,
3036
3042
log_in_real_time = log_in_real_time ,
3037
3043
)
3044
+
3045
+ def checkout (self , * , branch : str ) -> str :
3046
+ """Git branch checkout.
3047
+
3048
+ Examples
3049
+ --------
3050
+ >>> GitBranchCmd(path=git_local_clone.path).checkout(branch='master')
3051
+ "Your branch is up to date with 'origin/master'."
3052
+ """
3053
+ return self .cmd .run (
3054
+ [
3055
+ "checkout" ,
3056
+ * [branch ],
3057
+ ],
3058
+ )
3059
+
3060
+ def create (self , * , branch : str ) -> str :
3061
+ """Create a git branch.
3062
+
3063
+ Examples
3064
+ --------
3065
+ >>> GitBranchCmd(path=git_local_clone.path).create(branch='master')
3066
+ "fatal: a branch named 'master' already exists"
3067
+ """
3068
+ return self .cmd .run (
3069
+ [
3070
+ "checkout" ,
3071
+ * ["-b" , branch ],
3072
+ ],
3073
+ # Pass-through to run()
3074
+ check_returncode = False ,
3075
+ )
You can’t perform that action at this time.
0 commit comments