Skip to content

Add recursive search for .git directory [patch] #4

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bjsee
Copy link

@bjsee bjsee commented Nov 27, 2023

Instead of configuring the location of the .git directory as suggested in issue #3, the plugin will recursively search for a .git folder in the directory tree, starting from the project directory. This approach makes the plugin usable for mono-repos as well.

@bjsee
Copy link
Author

bjsee commented Dec 5, 2023

Hi @AnakinPt: What do you think about this PR?

@@ -50,4 +50,18 @@ public void apply(Project project) {
tagVersionTask.get().getVersion().set(innerProject.getVersion().toString());
});
}

static File findGitFolder(File rootDir) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use static methods.
You can use recursivity better.
findGit(folder){
if folder == null
throw exception
return folder.exists?folder:findFolder(folder.getParentDir)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I replaced the static method and improved the recursivity.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AnakinPt could you review again please?

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

Successfully merging this pull request may close these issues.

2 participants