X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=ls-files.c;h=f47114a168f3a7479cbe147f953e5f56af3d2dfc;hb=750a09a7de63c92868cff41a3151eac320c77fa0;hp=e3f43ecca1a39231f2855895433e66325abd7c06;hpb=7fe2fc79358673a909d71e62d3f80ffe0f525fce;p=git.git diff --git a/ls-files.c b/ls-files.c index e3f43ecc..f47114a1 100644 --- a/ls-files.c +++ b/ls-files.c @@ -31,7 +31,7 @@ static const char *tag_other = ""; static const char *tag_killed = ""; static const char *tag_modified = ""; -static char *exclude_per_dir = NULL; +static const char *exclude_per_dir = NULL; /* We maintain three exclude pattern lists: * EXC_CMDL lists patterns explicitly given on the command line. @@ -530,9 +530,9 @@ 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=] [--exclude-from=] " - "[ --exclude-per-directory= ]"; + "[ --exclude-per-directory= ] [--] []*"; -int main(int argc, char **argv) +int main(int argc, const char **argv) { int i; int exc_given = 0; @@ -542,8 +542,12 @@ int main(int argc, char **argv) prefix_offset = strlen(prefix); for (i = 1; i < argc; i++) { - char *arg = argv[i]; + const char *arg = argv[i]; + if (!strcmp(arg, "--")) { + i++; + break; + } if (!strcmp(arg, "-z")) { line_terminator = 0; continue;