-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Milestone
Description
Add support for fetching from remote before finishing a topic branch, which ensures the latest remote changes are incorporated in the merge.
- Add command line options to control fetching before branch finish:
--fetch- Fetch from remote before finishing branch--no-fetch- Explicitly disable fetching
- Ensure the git config setting is respected for each topic branch type individually
- Generic key:
gitflow.<topic>.finish.fetch - Examples:
gitflow.feature.finish.fetch,gitflow.release.finish.fetch,gitflow.hotfix.finish.fetch
- Generic key:
- When fetch is enabled, perform a
git fetchoperation on the relevant remote before merging the branch- Example:
git fetch <remote>before executing the merge and cleanup operations
- Example:
- Default to no-fetch when config setting is not present
- Update documentation to reflect the new option
- Add tests to verify the option works correctly for each branch type
- For testing purposes, you can use another local bare repo as “remote” by using its file URL
Test Cases:
-
Default Behavior (No Fetch)
- Create changes on remote that aren't in the local repo
- Finish a branch without specifying fetch option
- Expected: Branch is finished based on local state, without remote changes
- Verify merge doesn't include the remote changes
-
Fetch with Command Line (Positive)
- Create changes on remote that aren't in the local repo
- Test with command line:
git flow feature finish myfeature --fetch - Expected: Fetch occurs before finishing the branch
- Verify merge includes the latest remote changes
-
Fetch with Command Line (Negative)
- Create changes on remote that aren't in the local repo
- Set config:
gitflow.feature.finish.fetch=true - Test with command line:
git flow feature finish myfeature --no-fetch - Expected: No fetch occurs despite config setting
- Verify merge doesn't include the remote changes
-
Fetch with Config
- Create changes on remote that aren't in the local repo
- Set config:
gitflow.feature.finish.fetch=true - Finish a branch without specifying fetch option
- Expected: Fetch occurs before finishing the branch
- Verify merge includes the latest remote changes
-
Cross-Branch Type Tests
- Verify fetch works correctly for feature, release, and hotfix branches
- Test both positive and negative command line options
- Test with different configs for each branch type
Copilot
Metadata
Metadata
Assignees
Labels
No labels