summaryrefslogtreecommitdiff
path: root/git-checkout.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-12-05 00:07:57 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-12-06 07:25:52 (GMT)
commit1127148089234a6f84754f2f0ec36cbbcae06fa9 (patch)
tree7f2ea0007bda442b6138168f72d6aa7355309bff /git-checkout.sh
parentf8a9d4287277ed15d3f0d61004f4510c59f1f392 (diff)
downloadgit-1127148089234a6f84754f2f0ec36cbbcae06fa9.zip
git-1127148089234a6f84754f2f0ec36cbbcae06fa9.tar.gz
git-1127148089234a6f84754f2f0ec36cbbcae06fa9.tar.bz2
Loosen "working file will be lost" check in Porcelain-ish
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>
Diffstat (limited to 'git-checkout.sh')
-rwxr-xr-xgit-checkout.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/git-checkout.sh b/git-checkout.sh
index 737abd0..4192a99 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -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"
@@ -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