Skip to content

Commit

Permalink
Loosen "working file will be lost" check in Porcelain-ish
Browse files Browse the repository at this point in the history
This uses the previous update to read-tree in Porcelain-ish
commands "git checkout" and "git merge" to loosen the check
when switching branches.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Dec 6, 2006
1 parent f8a9d42 commit 1127148
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions git-checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ then
git-read-tree --reset -u $new
else
git-update-index --refresh >/dev/null
merge_error=$(git-read-tree -m -u $old $new 2>&1) || (
merge_error=$(git-read-tree -m -u --exclude-per-directory=.gitignore $old $new 2>&1) || (
case "$merge" in
'')
echo >&2 "$merge_error"
Expand All @@ -172,7 +172,8 @@ else
git diff-files --name-only | git update-index --remove --stdin &&
work=`git write-tree` &&
git read-tree --reset -u $new &&
git read-tree -m -u --aggressive $old $new $work || exit
git read-tree -m -u --aggressive --exclude-per-directory=.gitignore $old $new $work ||
exit

if result=`git write-tree 2>/dev/null`
then
Expand Down
2 changes: 1 addition & 1 deletion git-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ f,*)
echo "Updating $(git-rev-parse --short $head)..$(git-rev-parse --short $1)"
git-update-index --refresh 2>/dev/null
new_head=$(git-rev-parse --verify "$1^0") &&
git-read-tree -u -v -m $head "$new_head" &&
git-read-tree -v -m -u --exclude-per-directory=.gitignore $head "$new_head" &&
finish "$new_head" "Fast forward"
dropsave
exit 0
Expand Down

0 comments on commit 1127148

Please sign in to comment.