Skip to content

Commit 2a5f88f

Browse files
author
embs
committed
Hid keep file name in commit dialogue
1 parent d27a0f5 commit 2a5f88f

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

gitless/cli/commit_dialog.py

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import sys
1515
import shlex
1616

17+
from gitless import core
1718

1819
from . import pprint
1920

@@ -56,6 +57,8 @@ def show(files, repo):
5657
pprint.msg(
5758
'These are the files whose changes will be committed:', stream=cf.write)
5859
for f in files:
60+
if f.endswith(core.GL_KEEP_FILENAME):
61+
f = f.replace(core.GL_KEEP_FILENAME, '')
5962
pprint.item(f, stream=cf.write)
6063
pprint.sep(stream=cf.write)
6164
cf.close()

gitless/tests/test_e2e.py

+14
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
gl = Command('gl')
2121
git = Command('git')
2222

23+
from gitless import core
2324

2425
from gitless.tests import utils
2526

@@ -730,6 +731,19 @@ def test_tracked_empty_dir_status(self):
730731

731732
self.assertIn(expected_out, out, 'Didn\'t report newly tracked dir')
732733

734+
def test_commit_empty_dir(self):
735+
empty_dir = self._mk_empty_dir('wanted_empty_dir')
736+
gl.track(empty_dir)
737+
gl.commit(_out='std.out', _bg=True)
738+
739+
out = ''
740+
while(os.path.getsize('std.out') == 0 or out != open('std.out', 'r').read()):
741+
out = open('std.out', 'r').read()
742+
743+
self.assertIn(self._dir_path(empty_dir), out)
744+
self.assertFalse(core.GL_KEEP_FILENAME in out,
745+
'Output included gitless keep file name')
746+
733747
def test_untracked_empty_dir_status(self):
734748
untracked_empty_dir = self._mk_empty_dir('untracked_empty_dir')
735749
gl.track(untracked_empty_dir)

0 commit comments

Comments
 (0)