git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-ls-files -o no recurse?

From
DTDarrin Thompson <darrint@progeny.com>
Date
Jan 7, 2006, 18:20 UTC
Message-ID
<1136658055.6141.1.camel@localhost.localdomain>
In-Reply-To
<7vk6ddq8x2.fsf@assigned-by-dhcp.cox.net>
This adds a test a test for the --directory option to git-ls-files.
Is '--directory' really what we want?
 t/t3003-ls-files-others-directory.sh |   38
++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)
 create mode 100644 t/t3003-ls-files-others-directory.sh

applies-to: 5001806332081159b00c35291d6aea232ed7e909 d484a8477d430a5fb2cefd2cf7008a5973d1fea5

diff --git a/t/t3003-ls-files-others-directory.sh
b/t/t3003-ls-files-others-directory.sh
new file mode 100644
index 0000000..d1d3d86
--- /dev/null
+++ b/t/t3003-ls-files-others-directory.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Copyright (c) 2005 Darrin Thompson
+# Based on an earlier test by Junio C Hamano
+#
+
+test_description='git-ls-files test (--others --directory)
+
+This test runs git-ls-files --others --directory with the following on
+the filesystem.
+
+    path0       - a file
+    path1	- a symlink
+    path2/file2 - a file in a directory
+
+The --directory option should cause path2 to be in the listing, but
+not path2/file2.
+'
+. ./test-lib.sh
+
+date >path0
+ln -s xyzzy path1
+mkdir path2
+date >path2/file2
+test_expect_success \
+    'git-ls-files --directory --others to show output.' \
+    'git-ls-files --directory --others >output'
+cat >expected <<EOF
+output
+path0
+path1
+path2
+EOF
+
+test_expect_success \
+    'git-ls-files --directory --others should not pick up dir
contents.' \
+    'diff output expected'
+test_done
---
0.99.9i
Previous: Junio C HamanoNext: Darrin Thompson
Message 6 of 9 in “git-ls-files -o no recurse?”
  1. Darrin ThompsonJan 4, 2006
  2. Linus TorvaldsJan 4, 2006
  3. Darrin ThompsonJan 5, 2006
  4. Linus TorvaldsJan 5, 2006
  5. Junio C HamanoJan 6, 2006
  6. Darrin ThompsonJan 7, 2006
  7. Darrin ThompsonJan 7, 2006
  8. Junio C HamanoJan 7, 2006
  9. Linus TorvaldsJan 7, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.