-
Notifications
You must be signed in to change notification settings - Fork 103
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
Doesn't work on submodules. #54
Comments
I too have found myself wishing this would work with submodules. I believe it can be made to work pretty easily. All that seemingly needs to change is this function. Just need to check if the parent directory has a .gitmodules file, and a .git directory. I will try and submit a PR with these changes.
|
Add support for git submodules. Addresses issue #54.
merged & published |
Hey, super. Thanks very much for that. |
It works if the submodule is the first child of the root directory but not works if the submodule is in while !empty(req.path) {
var parentPath = path.dirname(req.path);
try {
stat = fs.statSync(parentPath + '/.gitmodules');
if (!stat.isFile()) {
var req.path = removeLastPart(req.path);
}
} catch (e) { }
}
return empty(req.path) ? false : true; |
Another option: if
If it contains |
Instead of check the existness of `.git` directory, use `git rev-parse` to check that `req.path` is in * a Git repository * a Git submodule * the root of the repo/submodule The old method didn't worked with submodules more than one level deep in the repo. Besides this if the $GIT_DIR differs from `.git` (cannot find a real life example), then the old method fails to work. Related to mixu#54
Instead of check the existness of `.git` directory, use `git rev-parse` to check that `req.path` is in * a Git repository * a Git submodule * the root of the repo/submodule The old method didn't worked with submodules more than one level deep in the repo. Besides this if the $GIT_DIR differs from `.git` (cannot find a real life example), then the old method fails to work. Related to mixu#54
Instead of check the existness of `.git` directory, use `git rev-parse` to check that `req.path` is in * a Git repository * a Git submodule * the root of the repo/submodule The old method didn't worked with submodules more than one level deep in the repo. Besides this if the $GIT_DIR differs from `.git` (cannot find a real life example), then the old method fails to work. Related to mixu#54
Please help me in #65 |
Instead of check the existness of `.git` directory, use `git rev-parse` to check that `req.path` is in * a Git repository * a Git submodule * the root of the repo/submodule The old method didn't worked with submodules more than one level deep in the repo. Besides this if the $GIT_DIR differs from `.git` (cannot find a real life example), then the old method fails to work. Related to mixu#54
Instead of check the existness of `.git` directory, use `git rev-parse` to check that `req.path` is in * a Git repository * a Git submodule * the root of the repo/submodule The old method didn't worked with submodules more than one level deep in the repo. Besides this if the $GIT_DIR differs from `.git` (cannot find a real life example), then the old method fails to work. Related to mixu#54
Just finished #65, please test it. |
If foo/ is a git repo containing a submodule bar/, and I try to execute 'status' on bar, I get: "Missing .git directory". Any chance this can generalized to work for submodules?
The text was updated successfully, but these errors were encountered: