From: Santi Béjar Date: Fri, 16 Mar 2007 10:46:09 GMT Subject: Re: Merging on a dirty tree??? Message-ID: <87slc54gb2.fsf@gmail.com> In-Reply-To: <200703152359.53543.dtor@insightbb.com> Dmitry Torokhov writes: > Hi, > > I just tried to pull from Linus' tree into my local tree and it seems > that fast forward was committed even though the tree was dirty: [...] > 19 files changed, 211 insertions(+), 80 deletions(-) > [dtor@anvil work]$ git --version > git version 1.5.0.3.438.gc49b2 > > It used to refuse merge if there were conflicts... Try with this patch. Santi -- >8 -- From: "Santi Béjar" Subject: [PATCH] git-merge: finish when git-read-tree fails The message formating (commit v1.5.0.3-28-gbe242d5) broke the && chain. Noticed by Dmitry Torokhov. Signed-off-by: Santi Béjar --- git-merge.sh | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/git-merge.sh b/git-merge.sh index 6ce62c8..8759c5a 100755 --- a/git-merge.sh +++ b/git-merge.sh @@ -292,13 +292,13 @@ f,*) # Again the most common case of merging one remote. 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 -v -m -u --exclude-per-directory=.gitignore $head "$new_head" && msg="Fast forward" if test -n "$have_message" then msg="$msg (no commit created; -m option ignored)" fi + new_head=$(git-rev-parse --verify "$1^0") && + git-read-tree -v -m -u --exclude-per-directory=.gitignore $head "$new_head" && finish "$new_head" "$msg" || exit dropsave exit 0 -- 1.5.0.4.1010.g688e