mirror of
https://github.com/git/git.git
synced 2024-11-24 10:26:17 +08:00
git-svn: dcommit should diff against the current HEAD after committing
This is a followup to dd31da2fdc
.
Regardless of whether we commit an alternate head, we always
diff-tree based on the current HEAD, and rebase against our
remote reference as necessary.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
39ed7c181b
commit
c3a41037ed
@ -512,15 +512,15 @@ sub dcommit {
|
|||||||
}
|
}
|
||||||
return if $_dry_run;
|
return if $_dry_run;
|
||||||
fetch();
|
fetch();
|
||||||
my @diff = command('diff-tree', $head, $gs, '--');
|
my @diff = command('diff-tree', 'HEAD', $gs, '--');
|
||||||
my @finish;
|
my @finish;
|
||||||
if (@diff) {
|
if (@diff) {
|
||||||
@finish = qw/rebase/;
|
@finish = qw/rebase/;
|
||||||
push @finish, qw/--merge/ if $_merge;
|
push @finish, qw/--merge/ if $_merge;
|
||||||
push @finish, "--strategy=$_strategy" if $_strategy;
|
push @finish, "--strategy=$_strategy" if $_strategy;
|
||||||
print STDERR "W: $head and $gs differ, using @finish:\n", @diff;
|
print STDERR "W: HEAD and $gs differ, using @finish:\n", @diff;
|
||||||
} else {
|
} else {
|
||||||
print "No changes between current $head and $gs\n",
|
print "No changes between current HEAD and $gs\n",
|
||||||
"Resetting to the latest $gs\n";
|
"Resetting to the latest $gs\n";
|
||||||
@finish = qw/reset --mixed/;
|
@finish = qw/reset --mixed/;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user