Skip to content

Commit

Permalink
revision.c: leave a note for "a lone :" enhancement
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed May 11, 2011
1 parent 25197eb commit 93e7d67
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions revision.c
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,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,
Expand Down

0 comments on commit 93e7d67

Please sign in to comment.