| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,5 +30,5 @@ checks: | |||
| 30 | 30 | ||
| 31 | 31 | - check: merge_base | |
| 32 | 32 | regex: main # it can be master, develop, devel etc based on your project. | |
| 33 | - error: Current branch is not up to date with target branch | ||
| 34 | - suggest: please ensure your branch is rebased with the target branch | ||
| 33 | + error: Current branch is not rebased onto target branch | ||
| 34 | + suggest: Please ensure your branch is rebased with the target branch | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -51,8 +51,8 @@ | |||
| 51 | 51 | { | |
| 52 | 52 | 'check': 'merge_base', | |
| 53 | 53 | 'regex': r'main', # it can be master, develop, devel etc based on your project. | |
| 54 | - 'error': 'Current branch is not up to date with target branch', | ||
| 55 | - 'suggest': 'please ensure your branch is rebased with the target branch', | ||
| 54 | + 'error': 'Current branch is not rebased onto target branch', | ||
| 55 | + 'suggest': 'Please ensure your branch is rebased with the target branch', | ||
| 56 | 56 | }, | |
| 57 | 57 | ], | |
| 58 | 58 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,8 +40,9 @@ def check_merge_base(checks: list) -> int: | |||
| 40 | 40 | f"{YELLOW}Not found target branch for checking merge base. skip checking.{RESET_COLOR}", | |
| 41 | 41 | ) | |
| 42 | 42 | return PASS | |
| 43 | + target_branch = check['regex'] if "origin/" in check['regex'] else f"origin/{check['regex']}" | ||
| 43 | 44 | current_branch = get_branch_name() | |
| 44 | - result = git_merge_base(check['regex'], current_branch) | ||
| 45 | + result = git_merge_base(target_branch, current_branch) | ||
| 45 | 46 | if result != 0: | |
| 46 | 47 | if not print_error_header.has_been_called: | |
| 47 | 48 | print_error_header() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -79,7 +79,7 @@ def get_parser() -> argparse.ArgumentParser: | |||
| 79 | 79 | parser.add_argument( | |
| 80 | 80 | '-mb', | |
| 81 | 81 | '--merge-base', | |
| 82 | - help='check common ancestors', | ||
| 82 | + help='check branch is rebased onto target branch', | ||
| 83 | 83 | action="store_true", | |
| 84 | 84 | required=False, | |
| 85 | 85 | ) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments