Skip to content

Commit 93e7d67

Browse files
committed
revision.c: leave a note for "a lone :" enhancement
If we later add a command in the log family that by default limit its operation to the current subdirectory, we would need to resurrect the "a lone ':' on the command line means no pathspec whatsoever". Now the codepath was cleaned up, we can do so in one place. Leave a note to mark where it is for later generations. Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 25197eb commit 93e7d67

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

revision.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,6 +1589,20 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
15891589
}
15901590

15911591
if (prune_data.nr) {
1592+
/*
1593+
* If we need to introduce the magic "a lone ':' means no
1594+
* pathspec whatsoever", here is the place to do so.
1595+
*
1596+
* if (prune_data.nr == 1 && !strcmp(prune_data[0], ":")) {
1597+
* prune_data.nr = 0;
1598+
* prune_data.alloc = 0;
1599+
* free(prune_data.path);
1600+
* prune_data.path = NULL;
1601+
* } else {
1602+
* terminate prune_data.alloc with NULL and
1603+
* call init_pathspec() to set revs->prune_data here.
1604+
* }
1605+
*/
15921606
ALLOC_GROW(prune_data.path, prune_data.nr+1, prune_data.alloc);
15931607
prune_data.path[prune_data.nr++] = NULL;
15941608
init_pathspec(&revs->prune_data,

0 commit comments

Comments
 (0)