aboutsummaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-05-23 09:58:35 -0700
committerJunio C Hamano <gitster@pobox.com>2011-05-23 09:58:35 -0700
commitbe5ab43566a7f9ea663349dbb9d7e83e270b3396 (patch)
treecc2d48f22dcfe9969c7ab2be2a6fbf596431347b /revision.c
parentb7aba2ef3450832828148e1a71b6a7198614b43d (diff)
parent488201c87e284ae06323b534c31e354811fb0d51 (diff)
downloadgit-be5ab43566a7f9ea663349dbb9d7e83e270b3396.tar.gz
git-be5ab43566a7f9ea663349dbb9d7e83e270b3396.tar.xz
Merge branch 'jc/magic-pathspec'
* jc/magic-pathspec: setup.c: Fix some "symbol not declared" sparse warnings t3703: Skip tests using directory name ":" on Windows revision.c: leave a note for "a lone :" enhancement t3703, t4208: add test cases for magic pathspec rev/path disambiguation: further restrict "misspelled index entry" diag fix overslow :/no-such-string-ever-existed diagnostics fix overstrict :<path> diagnosis grep: use get_pathspec() correctly pathspec: drop "lone : means no pathspec" from get_pathspec() Revert "magic pathspec: add ":(icase)path" to match case insensitively" magic pathspec: add ":(icase)path" to match case insensitively magic pathspec: futureproof shorthand form magic pathspec: add tentative ":/path/from/top/level" pathspec support
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/revision.c b/revision.c
index cf0b00157..7934b2f68 100644
--- a/revision.c
+++ b/revision.c
@@ -1661,6 +1661,20 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
}
if (prune_data.nr) {
+ /*
+ * If we need to introduce the magic "a lone ':' means no
+ * pathspec whatsoever", here is the place to do so.
+ *
+ * if (prune_data.nr == 1 && !strcmp(prune_data[0], ":")) {
+ * prune_data.nr = 0;
+ * prune_data.alloc = 0;
+ * free(prune_data.path);
+ * prune_data.path = NULL;
+ * } else {
+ * terminate prune_data.alloc with NULL and
+ * call init_pathspec() to set revs->prune_data here.
+ * }
+ */
ALLOC_GROW(prune_data.path, prune_data.nr+1, prune_data.alloc);
prune_data.path[prune_data.nr++] = NULL;
init_pathspec(&revs->prune_data,