You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The blame command works for files which are direct children of my-api except for any files under my-api/my-api module.
Please see the following code that I am using to check this behaviour
public class Jgit {
static final String REPO = "/Users/kapil-mangtani/IdeaProjects/my-api/.git";
static final String PATH1 = "settings.gradle";
static final String PATH2 = ".github/workflows/build-deploy-dev.yml";
static final String PATH3 = "my-api/src/main/java/com/example/Application.java";
public static void main(String[] args) throws Exception {
FileRepositoryBuilder builder = new FileRepositoryBuilder();
Git git = new Git(builder.setGitDir(new File(REPO)).readEnvironment().findGitDir().build());
BlameCommand blameCommand = git.blame().setFilePath(PATH1);
BlameResult result = blameCommand.call();
assert result != null; // TRUE
BlameCommand blameCommand1 = git.blame().setFilePath(PATH2);
BlameResult result1 = blameCommand1.call();
assert result1 != null; // TRUE
BlameCommand blameCommand2 = git.blame().setFilePath(PATH3);
BlameResult result2 = blameCommand2.call();
assert result2 != null; // FALSE for versions above 5.5.1
}
In my build.gradle file, I have implementation 'org.eclipse.jgit:org.eclipse.jgit:<version>'
Now when the version is 5.5.1 or below, result2 is not null and contains the blame result, but any version after that eg. 5.13.3, or 6.2.0 or even the latest one 7.1.0 returns the result2 as null. I have verified the same behaviour using the standalone sh file as well for the same versions using the blame -w command
Actual behavior
blame result is null as seen in the code snippet above
Expected behavior
blame result to be non-null with author and commit information (as seen in versions 5.5.1 and prior)
Relevant log output
No response
Other information
No response
The text was updated successfully, but these errors were encountered:
unkali
changed the title
Blame command returns null for gradle module
Blame command returns null result for gradle module
Dec 10, 2024
Version
All versions after 5.5.1
Operating System
MacOS
Bug description
I have a gradle project with the following repository structure (Java version : 17)
The blame command works for files which are direct children of
my-api
except for any files undermy-api/my-api
module.Please see the following code that I am using to check this behaviour
In my build.gradle file, I have
implementation 'org.eclipse.jgit:org.eclipse.jgit:<version>'
Now when the
version
is 5.5.1 or below,result2
is not null and contains the blame result, but any version after that eg. 5.13.3, or 6.2.0 or even the latest one 7.1.0 returns the result2 as null. I have verified the same behaviour using the standalone sh file as well for the same versions using theblame -w
commandActual behavior
blame result is null as seen in the code snippet above
Expected behavior
blame result to be non-null with author and commit information (as seen in versions 5.5.1 and prior)
Relevant log output
No response
Other information
No response
The text was updated successfully, but these errors were encountered: