New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix git-meta rm path overmatching issue #687

merged 2 commits into from Nov 10, 2018


None yet
3 participants
Copy link

shijinglu commented Nov 9, 2018

Currently running git meta rm -rf abc matches following directories which should not have:


The issue is because getSubmodulesInPath in the submodule_utils.js has a bug: it thinks if x.startsWith(y) than x must be a subdirectory of y. This is not true as abcd/ef/ starts with abc, but it is not a subdirectory of the later.

I changed to logic to:

  1. If y has a trailing '/' then startsWith is sufficient
  2. Otherwise, removing prefix x from y, the rest of y should starts with a leading /.
Copy link

bpeabody left a comment

Looks good!

Show resolved Hide resolved node/lib/util/submodule_util.js Outdated
@@ -38,7 +38,6 @@ const NodeGit = require("nodegit");

const Checkout = require("./checkout");
const CherryPickUtil = require("./cherry_pick_util");
const Commit = require("./commit");

This comment has been minimized.


shijinglu Nov 9, 2018


removed according to jslint


novalis approved these changes Nov 9, 2018

@shijinglu shijinglu merged commit 26f63d7 into twosigma:master Nov 10, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed

@shijinglu shijinglu deleted the shijinglu:fix_rm_overmatch branch Nov 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment