Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 9926f66

Browse files
ojabgitster
authored andcommitted
Fix git svn rebase & dcommit if top-level HEAD directory exist
When a file (or a directory) called HEAD exists in the working tree, internal calls git svn makes trigger "did you mean a revision or a path?" ambiguity check. $ git svn rebase fatal: ambiguous argument 'HEAD': both revision and filename Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' rev-list --first-parent --pretty=medium HEAD: command returned error: 128 Explicitly disambiguate by adding "--" after the revision. Signed-off-by: Slava Kardakov <[email protected]> Reviewed-by: Jeff King <[email protected]> Acked-by: Eric Wong <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4d1c565 commit 9926f66

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

git-svn.perl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ sub dcommit_rebase {
831831
sub cmd_dcommit {
832832
my $head = shift;
833833
command_noisy(qw/update-index --refresh/);
834-
git_cmd_try { command_oneline(qw/diff-index --quiet HEAD/) }
834+
git_cmd_try { command_oneline(qw/diff-index --quiet HEAD --/) }
835835
'Cannot dcommit with a dirty index. Commit your changes first, '
836836
. "or stash them with `git stash'.\n";
837837
$head ||= 'HEAD';
@@ -1932,7 +1932,7 @@ sub cmt_sha2rev_batch {
19321932
sub working_head_info {
19331933
my ($head, $refs) = @_;
19341934
my @args = qw/rev-list --first-parent --pretty=medium/;
1935-
my ($fh, $ctx) = command_output_pipe(@args, $head);
1935+
my ($fh, $ctx) = command_output_pipe(@args, $head, "--");
19361936
my $hash;
19371937
my %max;
19381938
while (<$fh>) {

0 commit comments

Comments
 (0)