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.
This commit is contained in:
Mark Johnston committed 2026-07-24 21:10:26 +00:00
1 parent 7392dc9d26
commit b86e364934
1 file changed
+5 -5
+5 -5
View File
@@ -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