Skip to content

Commit 799ce69

Browse files
committed
Rename no-stash-ignored to move-ignored for consistency with gitless terminology
1 parent 470d560 commit 799ce69

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

gitless/cli/gl_switch.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ def parser(subparsers, _):
2121
help='move uncomitted changes made in the current branch to the '
2222
'destination branch',
2323
action='store_true')
24-
switch_parser.add_argument('-ni', '--no-stash-ignored',
25-
help='do not stash ignored files, has no effect if --move-over is also set',
24+
switch_parser.add_argument('-mi', '--move-ignored',
25+
help='move ignored files to the destination branch, '
26+
'has no effect if --move-over is also set',
2627
action='store_true')
2728
switch_parser.set_defaults(func=main)
2829

@@ -36,6 +37,6 @@ def main(args, repo):
3637
pprint.err_exp('to create a new branch do gl branch -c {0}'.format(args.branch))
3738
return False
3839

39-
repo.switch_current_branch(b, move_over=args.move_over, no_stash_ignored=args.no_stash_ignored)
40+
repo.switch_current_branch(b, move_over=args.move_over, move_ignored=args.move_ignored)
4041
pprint.ok('Switched to branch {0}'.format(args.branch))
4142
return True

gitless/core.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,16 +256,15 @@ def listall_branches(self):
256256
"""
257257
return self.git_repo.listall_branches(pygit2.GIT_BRANCH_LOCAL)
258258

259-
def switch_current_branch(self, dst_b, move_over=False, no_stash_ignored=False):
259+
def switch_current_branch(self, dst_b, move_over=False, move_ignored=False):
260260
"""Switches to the given branch.
261261
262262
Args:
263263
dst_b: the destination branch.
264264
move_over: if True, then uncommitted changes made in the current branch are
265265
moved to the destination branch (defaults to False).
266-
no_stash_ignored: if move_over is False and no_stash_ignored is True, then
267-
stash only non-ignored files. If both move_over and
268-
no_stash_ignored are False, then stash all files, including ignored files.
266+
move_ignored: if True, and move_over is False, then ignored files are moved
267+
to the destination branch, but uncommitted changes are not (defaults to False).
269268
"""
270269
if dst_b.is_current:
271270
raise ValueError(
@@ -349,7 +348,7 @@ def save(b):
349348

350349
if not move_over:
351350
# Stash
352-
if no_stash_ignored:
351+
if move_ignored:
353352
git.stash.save('--include-untracked', '--', msg)
354353
else:
355354
git.stash.save('--all', '--', msg)

0 commit comments

Comments
 (0)