{"thread":{"id":"43773","subject":"[PATCH 2/2] Loosen \"working file will be lost\" check in Porcelain-ish","startedAt":"2006-12-05T01:11:02Z","lastAt":"2006-12-05T01:11:02Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"298490","messageId":"7vbqmjkuzd.fsf@assigned-by-dhcp.cox.net","threadId":"43773","inReplyTo":null,"subject":"[PATCH 2/2] Loosen \"working file will be lost\" check in Porcelain-ish","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-05T01:11:02Z","receivedAt":"2006-12-05T01:11:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This uses the previous update to read-tree in Porcelain-ish\ncommands \"git checkout\" and \"git merge\" to loosen the check\nwhen switching branches.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n git-checkout.sh |    5 +++--\n git-merge.sh    |    2 +-\n 2 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/git-checkout.sh b/git-checkout.sh\nindex 737abd0..a2be213 100755\n--- a/git-checkout.sh\n+++ b/git-checkout.sh\n@@ -161,7 +161,7 @@ then\n     git-read-tree --reset -u $new\n else\n     git-update-index --refresh >/dev/null\n-    merge_error=$(git-read-tree -m -u $old $new 2>&1) || (\n+    merge_error=$(git-read-tree -m -u --ignore=.gitignore $old $new 2>&1) || (\n \tcase \"$merge\" in\n \t'')\n \t\techo >&2 \"$merge_error\"\n@@ -172,7 +172,8 @@ else\n     \tgit diff-files --name-only | git update-index --remove --stdin &&\n \twork=`git write-tree` &&\n \tgit read-tree --reset -u $new &&\n-\tgit read-tree -m -u --aggressive $old $new $work || exit\n+\tgit read-tree -m -u --aggressive --ignore=.gitignore $old $new $work ||\n+\texit\n \n \tif result=`git write-tree 2>/dev/null`\n \tthen\ndiff --git a/git-merge.sh b/git-merge.sh\nindex 272f004..830f471 100755\n--- a/git-merge.sh\n+++ b/git-merge.sh\n@@ -264,7 +264,7 @@ f,*)\n \techo \"Updating $(git-rev-parse --short $head)..$(git-rev-parse --short $1)\"\n \tgit-update-index --refresh 2>/dev/null\n \tnew_head=$(git-rev-parse --verify \"$1^0\") &&\n-\tgit-read-tree -u -v -m $head \"$new_head\" &&\n+\tgit-read-tree -v -m -u --ignore=.gitignore $head \"$new_head\" &&\n \tfinish \"$new_head\" \"Fast forward\"\n \tdropsave\n \texit 0\n-- \n1.4.4.1.ga37e\n\n"}]}