scalar: validate the optional enlistment argument
commitb44855743b1674caf3bd4f42814473771b129c48
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Sat, 28 May 2022 23:11:14 +0000 (28 16:11 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 31 May 2022 06:07:31 +0000 (30 23:07 -0700)
tree74ed1a2d99c66ac366f69a2bbfefb984bd9b98ea
parentde1f68a968e64b3e1e2979222238fec1f045bbf3
scalar: validate the optional enlistment argument

The `scalar` command needs a Scalar enlistment for many subcommands, and
looks in the current directory for such an enlistment (traversing the
parent directories until it finds one).

These is subcommands can also be called with an optional argument
specifying the enlistment. Here, too, we traverse parent directories as
needed, until we find an enlistment.

However, if the specified directory does not even exist, or is not a
directory, we should stop right there, with an error message.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/scalar/scalar.c
contrib/scalar/t/t9099-scalar.sh