Re: Merging on a dirty tree???

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dmitry Torokhov <dtor@xxxxxxxxxxxxx> 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" <sbejar@xxxxxxxxx>
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 <sbejar@xxxxxxxxx>
---
 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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]