From: Junio C Hamano <gitster@pobox.com>
To: Pieter de Bie <pdebie@ai.rug.nl>
Cc: Git Mailinglist <git@vger.kernel.org>,
Miklos Vajna <vmiklos@frugalware.org>
Subject: "git-merge": allow fast-forwarding in a stat-dirty tree
Date: Wed, 20 Aug 2008 15:09:28 -0700 [thread overview]
Message-ID: <7vljyrnxt3.fsf_-_@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <EAFC48F0-5512-4A83-B9B2-44FF53319285@ai.rug.nl> (Pieter de Bie's message of "Wed, 20 Aug 2008 23:29:35 +0200")
We used to refresh the index to clear stat-dirtyness before a fast-forward
merge. Recent C rewrite forgot to do this.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
builtin-merge.c | 2 +-
t/t7600-merge.sh | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletions(-)
diff --git c/builtin-merge.c w/builtin-merge.c
index dde0c7e..a201c66 100644
--- c/builtin-merge.c
+++ w/builtin-merge.c
@@ -566,6 +566,7 @@ static int checkout_fast_forward(unsigned char *head, unsigned char *remote)
if (read_cache_unmerged())
die("you need to resolve your current index first");
+ refresh_cache(REFRESH_QUIET);
fd = hold_locked_index(lock_file, 1);
@@ -936,7 +937,6 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
hex,
find_unique_abbrev(remoteheads->item->object.sha1,
DEFAULT_ABBREV));
- refresh_cache(REFRESH_QUIET);
strbuf_init(&msg, 0);
strbuf_addstr(&msg, "Fast forward");
if (have_message)
diff --git c/t/t7600-merge.sh w/t/t7600-merge.sh
index 5eeb6c2..fee8fb7 100755
--- c/t/t7600-merge.sh
+++ w/t/t7600-merge.sh
@@ -488,4 +488,14 @@ test_expect_success 'merge c1 with c1 and c2' '
test_debug 'gitk --all'
+test_expect_success 'merge fast-forward in a dirty tree' '
+ git reset --hard c0 &&
+ mv file file1 &&
+ cat file1 >file &&
+ rm -f file1 &&
+ git merge c2
+'
+
+test_debug 'gitk --all'
+
test_done
next prev parent reply other threads:[~2008-08-20 22:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-20 21:00 [BUG] pull faulty 'not uptodate' Pieter de Bie
2008-08-20 21:22 ` Junio C Hamano
2008-08-20 21:29 ` [bug] " Pieter de Bie
2008-08-20 21:50 ` Junio C Hamano
2008-08-20 21:50 ` Junio C Hamano
2008-08-20 22:09 ` Junio C Hamano [this message]
2008-08-20 22:35 ` "git-merge": allow fast-forwarding in a stat-dirty tree Miklos Vajna
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vljyrnxt3.fsf_-_@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=pdebie@ai.rug.nl \
--cc=vmiklos@frugalware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).