author | Junio C Hamano <gitster@pobox.com> | |
Thu, 10 Dec 2009 23:27:51 +0000 (15:27 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 10 Dec 2009 23:29:05 +0000 (15:29 -0800) | ||
commit | 782a0005fcb26bb7ef27f720fd139ae40a6f434b | |
tree | 53c956ee887db28a5c48ce8d146862055dd9b1eb | tree | snapshot |
parent | 1456b043fc0f0a395c35d6b5e55b0dad1b6e7acc | commit | diff |
Fix archive format with -- on the command line
Giving --format from the command line, or using output file extention to
DWIM the output format, with a pathspec that is disambiguated with an
explicit double-dash on the command line, e.g.
git archive -o file --format=zip HEAD -- path
git archive -o file.zip HEAD -- path
didn't work correctly.
This was because the code reordered (when one was given) or added (when
the format was inferred) a --format argument at the end, effectively
making it to "archive HEAD -- path --format=zip", i.e. an extra pathspec
that is unlikely to match anything.
The command line argument list should always be "options, revs and then
paths", and we should set a good example by inserting the --format at the
beginning instead.
Reported-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Giving --format from the command line, or using output file extention to
DWIM the output format, with a pathspec that is disambiguated with an
explicit double-dash on the command line, e.g.
git archive -o file --format=zip HEAD -- path
git archive -o file.zip HEAD -- path
didn't work correctly.
This was because the code reordered (when one was given) or added (when
the format was inferred) a --format argument at the end, effectively
making it to "archive HEAD -- path --format=zip", i.e. an extra pathspec
that is unlikely to match anything.
The command line argument list should always be "options, revs and then
paths", and we should set a good example by inserting the --format at the
beginning instead.
Reported-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-archive.c | diff | blob | history |