From c8cfa3e4a5b1d1d4c870c82d2dbf162f570f0561 Mon Sep 17 00:00:00 2001 From: Benoit Sigoure Date: Sun, 11 Nov 2007 19:41:41 +0100 Subject: 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: Benoit Sigoure Acked-by: Eric Wong Signed-off-by: Junio C Hamano --- git-svn.perl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'git-svn.perl') diff --git a/git-svn.perl b/git-svn.perl index ec25ea4231..4c779b6c6d 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -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); -- cgit v1.2.3