提交 c8cfa3e4 编写于 作者: B Benoit Sigoure 提交者: Junio C Hamano

git-svn: prevent dcommitting if the index is dirty.

dcommit uses rebase to sync the history with what has just been pushed to
SVN.  Trying to dcommit with a dirty index is troublesome for rebase, so now
the user will get an error message if he attempts to dcommit with a dirty
index.
Signed-off-by: NBenoit Sigoure <tsuna@lrde.epita.fr>
Acked-by: NEric Wong <normalperson@yhbt.net>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 a91ef6e7
......@@ -374,6 +374,9 @@ sub cmd_set_tree {
sub cmd_dcommit {
my $head = shift;
git_cmd_try { command_oneline(qw/diff-index --quiet HEAD/) }
'Cannot dcommit with a dirty index. Commit your changes first'
. "or stash them with `git stash'.\n";
$head ||= 'HEAD';
my @refs;
my ($url, $rev, $uuid, $gs) = working_head_info($head, \@refs);
......
......@@ -53,4 +53,10 @@ test_expect_success 'change file but in unrelated area' "
test x\"\`sed -n -e 61p < file\`\" = x6611
"
test_expect_failure 'attempt to dcommit with a dirty index' '
echo foo >>file &&
git add file &&
git svn dcommit
'
test_done
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册