Skip to content

Commit f60c62d

Browse files
authored
use origins as main remote (patched-codes#125)
1 parent 5743b88 commit f60c62d

File tree

5 files changed

+91
-89
lines changed

5 files changed

+91
-89
lines changed

patchwork/steps/CreatePR/CreatePR.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def run(self) -> dict:
6363
if not self.enabled:
6464
return dict()
6565

66-
original_remote_name = repo.heads[self.base_branch].tracking_branch().remote_name
66+
original_remote_name = "origin"
6767
original_remote_url = repo.remotes[original_remote_name].url
6868
push_args = ["--set-upstream", original_remote_name, self.target_branch]
6969
if self.force:

patchwork/steps/ExtractCode/ExtractCode.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ def get_source_code_context(
2323
for context_strategy in context_strategies:
2424
context_start, context_end = context_strategy.get_context_indexes(source_lines, start_line, end_line)
2525
if context_start is None or context_end is None:
26-
logger.info(f'Context Strategy: "{context_strategy.__class__.__name__}" failed to return context')
26+
logger.debug(f'Context Strategy: "{context_strategy.__class__.__name__}" failed to return context')
2727
continue
2828

29-
logger.info(f'"{context_strategy.__class__.__name__}" Context Strategy used: {context_start}, {context_end}')
29+
logger.debug(f'"{context_strategy.__class__.__name__}" Context Strategy used: {context_start}, {context_end}')
3030
context = "".join(source_lines[context_start:context_end])
3131
if count_openai_tokens(context) <= context_token_length:
3232
return context_start, context_end
@@ -211,7 +211,7 @@ def transform_sarif_results(
211211
file_path = str(uri.relative_to(base_path))
212212

213213
# Extract lines from the code file
214-
logger.info(f"Extracting context for {file_path} at {start_line}:{end_line}")
214+
logger.debug(f"Extracting context for {file_path} at {start_line}:{end_line}")
215215
try:
216216
with open_with_chardet(file_path, "r") as file:
217217
src = file.read()
@@ -229,10 +229,10 @@ def transform_sarif_results(
229229
context_start = None
230230
context_end = None
231231
source_code_context = None
232-
logger.info(f"File not found in the current working directory: {file_path}")
232+
logger.debug(f"File not found in the current working directory: {file_path}")
233233

234234
if source_code_context is None:
235-
logger.info(f"No context found for {file_path} at {start_line}:{end_line}")
235+
logger.debug(f"No context found for {file_path} at {start_line}:{end_line}")
236236
continue
237237

238238
start = context_start if context_start is not None else start_line

patchwork/steps/ExtractCode/typed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
class ExtractCodeInputs(TypedDict):
5-
sarif_data: dict
5+
sarif_values: dict
66
context_size: NotRequired[int]
77
vulnerability_limit: NotRequired[int]
88
severity: NotRequired[str]

0 commit comments

Comments
 (0)