Checking for conflicts present during gdk update
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this merge request do and why?
This MR aims to check for the presence of conflicts during gdk update to cleanly abort the process with an error. The new changes checks for conflict status of a file if present and/or conflict markers. The specs are updated accordingly.
| Before | After |
|---|---|
|
|
How to set up and validate locally
To test the new changes, use these commands:
1. Using GDK_SELF_UPDATE=0 gdk update or bundle exec rake update:gitlab-git-pull
cd gitlab
echo "test1" > README.md
git stash save -u
echo "test2" > README.md
git add README.md
git commit -m 'testing'
git stash apply
GDK_SELF_UPDATE=0 gdk update
2. Run tests using bundle exec rspec spec/lib/gdk/project/git_worktree_spec.rb
Impacted categories
The following categories relate to this merge request:
-
gdk-reliability - e.g. When a GDK action fails to complete. -
gdk-usability - e.g. Improvements or suggestions around how the GDK functions. -
gdk-performance - e.g. When a GDK action is slow or times out.
Merge request checklist
-
This MR references an issue describing the change. -
This change is backward compatible. If not, please include steps to communicate to our users. -
Tests added for new functionality. If not, please raise an issue to follow-up. -
Documentation added/updated, if needed. -
Announcement added, if change is notable. -
gdk doctortest added, if needed.
Closes #2607 (closed)
Edited by Samaksh Agarwal

