Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitflow
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tools
gitflow
Commits
49c7d029
Commit
49c7d029
authored
Jan 28, 2010
by
Vincent Driessen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial implementation of merge conflict resolution support.
parent
58995b5b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
1 deletion
+46
-1
git-flow-feature
git-flow-feature
+46
-1
No files found.
git-flow-feature
View file @
49c7d029
...
...
@@ -105,6 +105,31 @@ cmd_finish() {
gitflow_require_clean_working_tree
gitflow_require_branch $BRANCH
# detect if we're restoring from a merge conflict
if [ -f "$GIT_DIR/.gitflow/MERGE_BASE" ]; then
#
# TODO: detect that we're working on the correct branch here!
# The user need not necessarily have given the same $NAME twice here
# (although he/she should).
#
FINISH_BASE="$(cat "$GIT_DIR/.gitflow/MERGE_BASE")"
if gitflow_is_branch_merged_into $BRANCH $FINISH_BASE; then
rm -f "$GIT_DIR/.gitflow/MERGE_BASE"
helper_finish_cleanup
exit 0
else
echo
echo "Merge conflicts not resolved yet, use:"
echo " git mergetool"
echo " git commit"
echo
echo "You can then complete the finish by running it again:"
echo " git flow feature finish $NAME"
echo
exit 1
fi
fi
# update local repo with remote changes first, if asked
if [ $FLAG_FETCH -eq 1 ]; then
git fetch -q $ORIGIN $BRANCH
...
...
@@ -125,8 +150,28 @@ cmd_finish() {
git merge --no-ff $BRANCH
fi
if [ $? -ne 0 ]; then
# oops.. we have a merge conflict!
# write the given $BASE to a temporary file (we need it later)
mkdir -p "$GIT_DIR/.gitflow"
echo "$BASE" > "$GIT_DIR/.gitflow/MERGE_BASE"
echo
echo "There were merge conflicts. To resolve the merge conflict manually, use:"
echo " git mergetool"
echo " git commit"
echo
echo "You can then complete the finish by running it again:"
echo " git flow feature finish $NAME"
echo
exit 1
fi
# when no merge conflict is detected, just clean up the feature branch
helper_finish_cleanup
}
helper_finish_cleanup() {
# delete branch
# TODO: How do we handle merge conflicts here??
git push $ORIGIN :refs/heads/$BRANCH
git branch -d $BRANCH
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment