Skip to content
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

checkIsRepo() always return true #345

Closed
mittalyashu opened this issue Apr 17, 2019 · 6 comments
Closed

checkIsRepo() always return true #345

mittalyashu opened this issue Apr 17, 2019 · 6 comments

Comments

@mittalyashu
Copy link

mittalyashu commented Apr 17, 2019

Every time I try to run this code with git and non-git repository, it always returns true.

validateGit(path) {
			let validateGitRepo = git(path);
			validateGitRepo.checkIsRepo()
			.then(result => {
				console.log(result);
			}).catch(error => {
				console.log(error);
			});
		}

Answer: #345 (comment)

@steveukx
Copy link
Owner

There's now an integration test to show how the checkIsRepo interface is expected to work... the standard git binary will return true for any directory under a valid git root, which is what this library bases its response on.

Please can you add an integration test based on test-check-is-repo that shows how the result variable doesn't match true for a root / folder within a root, or false for any other directory.

@mittalyashu
Copy link
Author

the standard git binary will return true for any directory under a valid git root

I get that, but it was returning true even if git is not initialized inside the repository.

@mittalyashu
Copy link
Author

This code is exactly the same as you have written in the tests.

carbon

@mittalyashu
Copy link
Author

Hey @steveukx, did you got the chance to read the above comments?

@mittalyashu
Copy link
Author

the standard git binary will return true for any directory under a valid git root

What does it mean that it will always return true?

@mittalyashu
Copy link
Author

Found the cause of the problem, turns out that somehow I must have initialized a git repository in my C:// drive, which was causing the issue.

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

No branches or pull requests

2 participants