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>
Junio C Hamano committed
Dec 4, 2006 at 16:07 UTC
1127148089234a6f84754f2f0ec36cbbcae06fa9
2 files changed
+4
-3
git-checkout.sh
+3
-2
@@ -161,7 +161,7 @@ then
161
git-read-tree --reset -u $new
162
else
163
git-update-index --refresh >/dev/null
164
- merge_error=$(git-read-tree -m -u $old $new 2>&1) || (
164
+ merge_error=$(git-read-tree -m -u --exclude-per-directory=.gitignore $old $new 2>&1) || (
165
case "$merge" in
166
'')
167
echo >&2 "$merge_error"
@@ -172,7 +172,8 @@ else
172
git diff-files --name-only | git update-index --remove --stdin &&
173
work=`git write-tree` &&
174
git read-tree --reset -u $new &&
175
- git read-tree -m -u --aggressive $old $new $work || exit
175
+ git read-tree -m -u --aggressive --exclude-per-directory=.gitignore $old $new $work ||
176
+ exit
177
178
if result=`git write-tree 2>/dev/null`
179
then
git-merge.sh
+1
-1
@@ -264,7 +264,7 @@ f,*)
264
echo "Updating $(git-rev-parse --short $head)..$(git-rev-parse --short $1)"
265
git-update-index --refresh 2>/dev/null
266
new_head=$(git-rev-parse --verify "$1^0") &&
267
- git-read-tree -u -v -m $head "$new_head" &&
267
+ git-read-tree -v -m -u --exclude-per-directory=.gitignore $head "$new_head" &&
268
finish "$new_head" "Fast forward"
269
dropsave
270
exit 0