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

Git.changedLines returns empty values for PullRequestChangedLines object #250

Open
IvanSanchez-uam opened this issue Jul 12, 2023 · 0 comments

Comments

@IvanSanchez-uam
Copy link

I have these lines in my Danger.df.kts file

 warn("Additions = ${git.changedLines.additions}")
 warn("Deletions = ${git.changedLines.deletions}")
 warn("Diff = ${git.changedLines.diff ?: ""}")

in my case I want to get the diff but when calling changedLines extension function just give me

Additions = 0
Deletions = 0
Diff = null

is this extension function really working?, is there another way to get the diff?

I also tried to use the github.pullRequest but there is no a diff value here.

I have the feeling that these lines are not working

val Git.changedLines: PullRequestChangedLines
    get() {
        ...
        val commandRawOutput = shellExecutor.execute("git diff --numstat $headSha $baseSha")
        ...
        val commandRawDiffOutput = shellExecutor.execute("git diff $headSha $baseSha")
        return PullRequestChangedLines(additions, deletions, commandRawDiffOutput)
    }
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

No branches or pull requests

1 participant