Skip to content

Commit 00f9219

Browse files
authored
Improvements to make sure diffing changes
for non default branch works.
1 parent b4914ba commit 00f9219

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

contentctl/actions/detection_testing/GitHubService.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def get_detections_changed(self, director: DirectorOutputDto) -> list[Detection]
139139
)
140140
)
141141

142-
differences = self.repo.git.diff("--name-status", self.config.version_control_config.main_branch).split("\n")
142+
differences = self.repo.git.diff("--name-status", f"origin/{self.config.version_control_config.main_branch}").split("\n")
143143
new_content = []
144144
modified_content = []
145145
deleted_content = []

contentctl/objects/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ def validate_test_branch(cls, v, values):
413413

414414
r = git.Repo(values.get("repo_path"))
415415
try:
416-
if r.active_branch != v:
416+
if r.active_branch.name != v:
417417
print(f"We are trying to test {v} but the current active branch is {r.active_branch}")
418418
print(f"Checking out {v}")
419419
r.git.checkout(v)

0 commit comments

Comments
 (0)