The PullRequestDialog was trying to access `credentials.token` which doesn't exist
in the GitCredential interface. The actual token is stored in the `password` field.
Additionally, GitLab's API requires the `PRIVATE-TOKEN` header for Personal Access
Tokens, not `Authorization: Bearer`. Updated both the GitHub and GitLab API calls
to use the correct credential field and proper authentication headers.
Changes:
- Changed credentials.token to credentials.password for both GitHub and GitLab
- Updated GitLab API calls to use PRIVATE-TOKEN header instead of Authorization Bearer
- Added comprehensive logging to help debug credential issues
- Added validation to check if token is empty and provide helpful error message
This fixes the "401 Unauthorized" error when creating merge requests on GitLab.
Fix issues with pull request creation by improving remote URL parsing and adding comprehensive error logging.
FIXES:
- Normalize URLs before parsing (remove .git suffix first)
- More flexible regex patterns (handle both http and https)
- Better owner/repo extraction
- Clearer error messages showing detected platform
IMPROVEMENTS:
- Console logging for debugging PR creation flow
- Show which platform was detected (GitHub/GitLab)
- Log API URLs and request data
- Better error messages with status codes and response text
- Credential detection logging
ERROR HANDLING:
- Parse API error responses properly
- Show full error details in console
- Display helpful error messages to users
- Include URL and platform info in error messages
This should fix the "Failed to get GitLab Project: 401" error by:
1. Correctly detecting GitHub URLs (not misidentifying as GitLab)
2. Providing clear logging to diagnose credential issues
3. Showing which credentials are being used
Relocate merge and pull request buttons from Advanced Git Management dialog to the main Repository dialog for better accessibility and workflow.
CHANGES:
- Add "Branch Operations" card to GitDialog
- Display Merge Branch and Pull Request buttons directly in Repository dialog
- Remove duplicate buttons from GitManagementDialog branches tab
- Simplify GitManagementDialog component (removed merge/PR dialog state)
BENEFITS:
- More intuitive workflow: common operations are in the main dialog
- Cleaner separation: Repository dialog = operations, Advanced = exploration
- Faster access to merge/PR features without opening advanced dialog
The Merge and PR dialogs now open from the Repository dialog's "Branch Operations" section, making them easier to discover and use.