From 4d2a3646d1f0285ce072cdfe34a7df64710f9357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SZEDER=20G=C3=A1bor?= Date: Mon, 23 Nov 2015 13:23:16 +0100 Subject: filter-branch: deal with object name vs. pathname ambiguity in tree-filter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'git filter-branch' fails complaining about an ambiguous argument, if a tree-filter renames a path and the new pathname happens to match an existing object name. After the tree-filter has been applied, 'git filter-branch' looks for changed paths by running: git diff-index -r --name-only --ignore-submodules $commit which then, because of the lack of disambiguating double-dash, can't decide whether to treat '$commit' as revision or path and errors out. Add that disambiguating double-dash after 'git diff-index's revision argument to make sure that '$commit' is interpreted as a revision. Signed-off-by: SZEDER Gábor Signed-off-by: Jeff King --- git-filter-branch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git-filter-branch.sh') diff --git a/git-filter-branch.sh b/git-filter-branch.sh index fff8093d4..ad24c8d85 100755 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -319,7 +319,7 @@ while read commit parents; do die "tree filter failed: $filter_tree" ( - git diff-index -r --name-only --ignore-submodules $commit && + git diff-index -r --name-only --ignore-submodules $commit -- && git ls-files --others ) > "$tempdir"/tree-state || exit git update-index --add --replace --remove --stdin \ -- cgit v1.2.1