Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/gitsweep/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def _sweep(self):
for ref in ok_to_delete:
sys.stdout.write(' {0}\n'.format(ref.remote_head))

if not dry_run:
if not dry_run and ok_to_delete:
deleter = Deleter(repo, remote_name=remote_name,
master_branch=master_branch)

Expand Down
11 changes: 11 additions & 0 deletions src/gitsweep/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,14 @@ def test_will_force_clean(self):
Tell everyone to run `git fetch --prune` to sync with this remote.
(you don't have to, yours is synced)
''', stdout)

def test_cleanup_will_not_prompt_if_none_found(self):
"""
Will not prompt clean up if no branches found.
"""
(retcode, stdout, stderr) = self.gscommand('git-sweep cleanup')

self.assertResults('''
Fetching from the remote
No remote branches are available for cleaning up
''', stdout)