From: Richard Hansen Date: Tue, 10 Jan 2017 20:41:50 +0000 (-0500) Subject: rev-parse doc: pass "--" to rev-parse in the --prefix example X-Git-Tag: v2.12.0-rc0~60^2~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=11873b438faa13ff1416741bb48dbdaa8a6cc083;p=git rev-parse doc: pass "--" to rev-parse in the --prefix example The "--" argument avoids "ambiguous argument: unknown revision or path not in the working tree" errors when a pathname argument refers to a non-existent file. The "--" passed explicitly to set was removed because rev-parse outputs the "--" argument that it is given. Signed-off-by: Richard Hansen Signed-off-by: Junio C Hamano --- diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt index b6c6326cdc..7241e96893 100644 --- a/Documentation/git-rev-parse.txt +++ b/Documentation/git-rev-parse.txt @@ -91,7 +91,8 @@ repository. For example: ---- prefix=$(git rev-parse --show-prefix) cd "$(git rev-parse --show-toplevel)" -eval "set -- $(git rev-parse --sq --prefix "$prefix" "$@")" +# rev-parse provides the -- needed for 'set' +eval "set $(git rev-parse --sq --prefix "$prefix" -- "$@")" ---- --verify::