Skip to content

Implement repository synchronization and update remote URL handling#7

Open
ernivani wants to merge 1 commit into
mainfrom
6-bug-repository-not-syncing-properly-when-switching-computers
Open

Implement repository synchronization and update remote URL handling#7
ernivani wants to merge 1 commit into
mainfrom
6-bug-repository-not-syncing-properly-when-switching-computers

Conversation

@ernivani

@ernivani ernivani commented Dec 30, 2024

Copy link
Copy Markdown
Owner

Description

Fixed repository syncing issues between different computers by implementing proper Git synchronization mechanisms. This change ensures that the extension properly syncs repository data when switching between computers, even if the extension was previously used on both machines.

Fixes #6

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

These changes need to be tested before merging. Suggested test scenarios:

  • Test repository sync between two different computers with existing data
  • Verify that local changes are preserved during sync
  • Ensure no data loss occurs during synchronization
  • Test conflict resolution when both computers have local changes

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • The code changes handle all edge cases (existing repos, conflicts, etc.)

Note: Testing needs to be performed before merging this PR.

- Added a new `syncRepository` function to fetch changes from the remote repository, stash local changes if necessary, and reset the local repository to match `origin/main`.
- Updated `ensureLocalRepo` to remove and re-add the remote URL, ensuring it reflects any changes, and to call `syncRepository` for initial synchronization.
- Modified `commitAndPush` to sync with the remote before committing changes, ensuring the local repository is up-to-date.
- Enhanced error handling for stashing and applying local changes during synchronization.
@ernivani ernivani linked an issue Dec 30, 2024 that may be closed by this pull request
@ernivani ernivani self-assigned this Dec 30, 2024
@ernivani ernivani added the bug Something isn't working label Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Repository not syncing properly when switching computers

1 participant