mirror of
https://github.com/git/git.git
synced 2025-03-15 15:11:04 +00:00
Remove MERGE_HEAD in "git checkout/reset"
Both of these scripts will end up resetting the index to some specific head, and any unresolved merge will be forgotten.
This commit is contained in:
parent
6b38a402e9
commit
ef0bfa25e9
@ -37,4 +37,15 @@ then
|
|||||||
git-checkout-cache -q -f -u -a
|
git-checkout-cache -q -f -u -a
|
||||||
else
|
else
|
||||||
git-read-tree -m -u $old $new
|
git-read-tree -m -u $old $new
|
||||||
fi && [ "$branch" ] && ln -sf "refs/heads/$branch" "$GIT_DIR/HEAD"
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# Switch the HEAD pointer to the new branch if it we
|
||||||
|
# checked out a branch head, and remove any potential
|
||||||
|
# old MERGE_HEAD's (subsequent commits will clearly not
|
||||||
|
# be based on them, since we re-set the index)
|
||||||
|
#
|
||||||
|
if [ "$?" -eq 0 ]; then
|
||||||
|
[ "$branch" ] && ln -sf "refs/heads/$branch" "$GIT_DIR/HEAD"
|
||||||
|
rm -f "$GIT_DIR/MERGE_HEAD"
|
||||||
|
fi
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
: ${GIT_DIR=.git}
|
||||||
git-read-tree --reset HEAD
|
git-read-tree --reset HEAD
|
||||||
git-update-cache --refresh
|
git-update-cache --refresh
|
||||||
|
rm -f "$GIT_DIR/MERGE_HEAD"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user