Skip to content

Commit 5c66993

Browse files
committed
autogen.pl: tweak a regexp to handle more cases
The output of `git submodule status` will be of the following form: ``` Xgit_hash submodule_path [(git_ref)] ``` * `X` is either a space, `+`, or `-` * `git_hash` is 40 hex digits * `submodule_path` is the path in the repo where the submodule is located * `(git_ref)` is optional, and will not be there if the submodule is missing (which the previous regexp did not handle). This commit tightens up the regexp to be a bit more robust and handle the case where the git_ref token is not present. Signed-off-by: Jeff Squyres <[email protected]>
1 parent 9b87ffd commit 5c66993

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autogen.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1409,7 +1409,7 @@ sub replace_config_sub_guess {
14091409
open(IN, "git submodule status|")
14101410
|| die "Can't run \"git submodule status\"";
14111411
while (<IN>) {
1412-
$_ =~ m/^(.).{40} ([^ ]+) /;
1412+
$_ =~ m/^(.)[0-9a-f]{40}\s+(\S+)/;
14131413
my $status = $1;
14141414
my $path = $2;
14151415

0 commit comments

Comments
 (0)