summaryrefslogtreecommitdiff
path: root/diff-cache.c
diff options
context:
space:
mode:
authorJonas Fonseca <fonseca@diku.dk>2005-06-06 21:27:00 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-08 20:03:25 (GMT)
commite0f0e891c1742c6ae22dbc648a1000ad8655ff34 (patch)
treefc20786622f3fe0da7198a7d26bdd7cec7be9c06 /diff-cache.c
parent2a68a8659f7dc55fd285d235ae2d19e7a8116c30 (diff)
downloadgit-e0f0e891c1742c6ae22dbc648a1000ad8655ff34.zip
git-e0f0e891c1742c6ae22dbc648a1000ad8655ff34.tar.gz
git-e0f0e891c1742c6ae22dbc648a1000ad8655ff34.tar.bz2
[PATCH] git-diff-cache: handle pathspec beginning with a dash
Parse everything after '--' as tree name or pathspec. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'diff-cache.c')
-rw-r--r--diff-cache.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/diff-cache.c b/diff-cache.c
index e95fd70..1d355aa 100644
--- a/diff-cache.c
+++ b/diff-cache.c
@@ -167,13 +167,14 @@ int main(int argc, const char **argv)
void *tree;
unsigned long size;
int ret;
+ int allow_options = 1;
int i;
read_cache();
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
- if (*arg != '-') {
+ if (!allow_options || *arg != '-') {
if (tree_name) {
pathspec = argv + i;
break;
@@ -182,6 +183,10 @@ int main(int argc, const char **argv)
continue;
}
+ if (!strcmp(arg, "--")) {
+ allow_options = 0;
+ continue;
+ }
if (!strcmp(arg, "-r")) {
/* We accept the -r flag just to look like git-diff-tree */
continue;