aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2026-07-24 21:10:26 +0000
committerMark Johnston <markj@FreeBSD.org>2026-07-24 21:10:26 +0000
commitb86e36493469ded108ad616ebc094886b33851c4 (patch)
treeae6055ce1fee4c817077a03ce502d151ad5c9ab2
parent7392dc9d26830fe9d19e035d2e08f19dcca96591 (diff)
git-mfc: Improve handling of remotes
If we can't figure out which remote to use, print a useful error instead of assuming that "freebsd" is the right remote to use.
-rwxr-xr-xtools/tools/git/git-mfc10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/tools/git/git-mfc b/tools/tools/git/git-mfc
index 431ed2ebc861..c6c4ea2b786a 100755
--- a/tools/tools/git/git-mfc
+++ b/tools/tools/git/git-mfc
@@ -501,11 +501,11 @@ def main():
if args.remote:
remote = args.remote
else:
- try:
- tracking = repo.active_branch.tracking_branch()
- remote = tracking.remote_name if tracking else 'freebsd'
- except (TypeError, ValueError):
- remote = 'freebsd'
+ tracking = repo.active_branch.tracking_branch()
+ if tracking:
+ remote = tracking.remote_name
+ else:
+ err(1, "could not find upstream branch, use --remote")
upstream = remote + '/' + origin