Skip to content

Commit

Permalink
Fix the failing test around git command
Browse files Browse the repository at this point in the history
  • Loading branch information
yogeshnikam671 committed Oct 28, 2024
1 parent bb89eba commit 444af8d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ class BackwardCompatibilityCheckCommandV2Test {
.start()
.waitFor()

ProcessBuilder("git", "config", "--local", "user.name", "developer")
.directory(tempDir)
.inheritIO()
.start()
.waitFor()

ProcessBuilder("git", "config", "--local", "user.email", "[email protected]")
.directory(tempDir)
.inheritIO()
.start()
.waitFor()

ProcessBuilder("git", "remote", "add", "origin", remoteDir.absolutePath)
.directory(tempDir)
.inheritIO()
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/kotlin/io/specmatic/core/git/SystemGit.kt
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ class SystemGit(override val workingDirectory: String = ".", private val prefix:

override fun getFilesChangedInCurrentBranch(baseBranch: String): List<String> {
val committedLocalChanges = execute(Configuration.gitCommand, "diff", baseBranch, "HEAD", "--name-status")
.split(System.lineSeparator())
.split("\n")
val uncommittedChanges = execute(Configuration.gitCommand, "diff", "HEAD", "--name-status")
.split(System.lineSeparator())
.split("\n")

return (committedLocalChanges + uncommittedChanges).map {
it.split("\t").last()
Expand Down

0 comments on commit 444af8d

Please sign in to comment.