summaryrefslogtreecommitdiff
path: root/ls-files.c
diff options
context:
space:
mode:
authorFredrik Kuivinen <freku045@student.liu.se>2005-10-02 15:33:38 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-10-02 17:31:18 (GMT)
commit500b97e4bb184c954a52550843e6314ecf97a208 (patch)
tree5fbfe0441a8cea62a04ceee4f28cd517c62f386a /ls-files.c
parentaf215114f52af0f308ef19f67e544df8ea5e4ac2 (diff)
downloadgit-500b97e4bb184c954a52550843e6314ecf97a208.zip
git-500b97e4bb184c954a52550843e6314ecf97a208.tar.gz
git-500b97e4bb184c954a52550843e6314ecf97a208.tar.bz2
[PATCH] Teach git-ls-files about '--' to denote end of options.
Useful if you have a file whose name starts with a dash. Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'ls-files.c')
-rw-r--r--ls-files.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ls-files.c b/ls-files.c
index 956be09..f47114a 100644
--- a/ls-files.c
+++ b/ls-files.c
@@ -530,7 +530,7 @@ static void verify_pathspec(void)
static const char ls_files_usage[] =
"git-ls-files [-z] [-t] (--[cached|deleted|others|stage|unmerged|killed|modified])* "
"[ --ignored ] [--exclude=<pattern>] [--exclude-from=<file>] "
- "[ --exclude-per-directory=<filename> ]";
+ "[ --exclude-per-directory=<filename> ] [--] [<file>]*";
int main(int argc, const char **argv)
{
@@ -544,6 +544,10 @@ int main(int argc, const char **argv)
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
+ if (!strcmp(arg, "--")) {
+ i++;
+ break;
+ }
if (!strcmp(arg, "-z")) {
line_terminator = 0;
continue;