Parse everything after '--' as tree name or pathspec.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
void *tree;
unsigned long size;
int ret;
void *tree;
unsigned long size;
int ret;
int i;
read_cache();
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
int i;
read_cache();
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
+ if (!allow_options || *arg != '-') {
if (tree_name) {
pathspec = argv + i;
break;
if (tree_name) {
pathspec = argv + i;
break;
+ if (!strcmp(arg, "--")) {
+ allow_options = 0;
+ continue;
+ }
if (!strcmp(arg, "-r")) {
/* We accept the -r flag just to look like git-diff-tree */
continue;
if (!strcmp(arg, "-r")) {
/* We accept the -r flag just to look like git-diff-tree */
continue;