From: "Karl Hasselström" <kha@treskal.com>
To: Catalin Marinas <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org, "David Kågedal" <davidk@lysator.liu.se>
Subject: [StGit PATCH] Let "stg status" ignore empty directories
Date: Fri, 31 Aug 2007 21:43:57 +0200 [thread overview]
Message-ID: <20070831194348.18082.49366.stgit@yoghurt> (raw)
This was a really simple fix: just pass the right flag to
git-ls-files. Since the output has a trailing \0, split() gives us an
empty string at the end of the list that we have to throw away.
(Curiously, there was an empty string at the end before this change
too, but it disappeared somehow.)
This fixes bug 9891.
Signed-off-by: Karl Hasselström <kha@treskal.com>
---
stgit/git.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/stgit/git.py b/stgit/git.py
index f315b05..8857209 100644
--- a/stgit/git.py
+++ b/stgit/git.py
@@ -181,7 +181,8 @@ def tree_status(files = None, tree_id = 'HEAD', unknown = False,
# unknown files
if unknown:
- cmd = ['git-ls-files', '-z', '--others', '--directory']
+ cmd = ['git-ls-files', '-z', '--others', '--directory',
+ '--no-empty-directory']
if not noexclude:
cmd += ['--exclude=%s' % s for s in
['*.[ao]', '*.pyc', '.*', '*~', '#*', 'TAGS', 'tags']]
@@ -191,7 +192,7 @@ def tree_status(files = None, tree_id = 'HEAD', unknown = False,
if os.path.exists(fn)]
lines = GRun(*cmd).raw_output().split('\0')
- cache_files += [('?', line) for line in lines]
+ cache_files += [('?', line) for line in lines if line]
# conflicted files
conflicts = get_conflicts()
reply other threads:[~2007-08-31 19:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070831194348.18082.49366.stgit@yoghurt \
--to=kha@treskal.com \
--cc=catalin.marinas@gmail.com \
--cc=davidk@lysator.liu.se \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).