Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Sigoure <tsuna@lrde.epita.fr>2007-11-11 21:41:41 +0300
committerJunio C Hamano <gitster@pobox.com>2007-11-12 10:40:32 +0300
commitc8cfa3e4a5b1d1d4c870c82d2dbf162f570f0561 (patch)
tree0239d707b3f72e3eacfffadf91e5df289d47aa03 /git-svn.perl
parenta91ef6e75b897a255cc17b70014a39e68dd54c7a (diff)
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 <tsuna@lrde.epita.fr> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl3
1 files changed, 3 insertions, 0 deletions
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);