From: Stefan Beller <sbeller@google.com>
To: gitster@pobox.com
Cc: git@vger.kernel.org, Stefan Beller <sbeller@google.com>
Subject: [PATCH 1/2] entry.c: submodule recursing: respect force flag correctly
Date: Wed, 29 Mar 2017 11:37:42 -0700 [thread overview]
Message-ID: <20170329183743.27506-1-sbeller@google.com> (raw)
In case of a non-forced worktree update, the submodule movement is tested
in a dry run first, such that it doesn't matter if the actual update is
done via the force flag. However for correctness, we want to give the
flag is specified by the user.
Signed-off-by: Stefan Beller <sbeller@google.com>
---
entry.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/entry.c b/entry.c
index d2b512da90..645121f828 100644
--- a/entry.c
+++ b/entry.c
@@ -287,7 +287,7 @@ int checkout_entry(struct cache_entry *ce,
} else
return submodule_move_head(ce->name,
"HEAD", oid_to_hex(&ce->oid),
- SUBMODULE_MOVE_HEAD_FORCE);
+ state->force ? SUBMODULE_MOVE_HEAD_FORCE : 0);
}
if (!changed)
--
2.12.0.rc1.52.g2de7d24de9.dirty
next reply other threads:[~2017-03-29 18:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-29 18:37 Stefan Beller [this message]
2017-03-29 18:37 ` [PATCH 2/2] unpack-trees.c: align submodule error message to the other error messages Stefan Beller
2017-03-29 18:48 ` Jonathan Nieder
2017-03-29 21:33 ` Junio C Hamano
2017-03-29 22:34 ` [PATCH] " Stefan Beller
2017-03-29 22:47 ` Junio C Hamano
2017-03-29 18:45 ` [PATCH 1/2] entry.c: submodule recursing: respect force flag correctly Jonathan Nieder
2017-03-29 21:30 ` Junio C Hamano
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=20170329183743.27506-1-sbeller@google.com \
--to=sbeller@google.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).