summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5bcbc7f)
raw | patch | inline | side by side (parent: 5bcbc7f)
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Mon, 9 Apr 2007 15:12:53 +0000 (17:12 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 10 Apr 2007 01:51:40 +0000 (18:51 -0700) |
As noted by Junio, --format=tar should be assumed if no format
was specified.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
was specified.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-archive.txt | patch | blob | history | |
builtin-archive.c | patch | blob | history | |
t/t5000-tar-tree.sh | patch | blob | history |
index 493474b2eeabb2f7928b0e9f91cfd1ff64763a6d..8d1041598e566a3ffc87cbe294c7800be1ab0c60 100644 (file)
-------
--format=<fmt>::
- Format of the resulting archive: 'tar', 'zip'...
+ Format of the resulting archive: 'tar', 'zip'... The default
+ is 'tar'.
--list::
Show all available formats.
diff --git a/builtin-archive.c b/builtin-archive.c
index 8ea6cb1efc4f988fb09051852f9e51fc88b5efd7..7f4e409c998ba4a864bd39032556d71693ff6793 100644 (file)
--- a/builtin-archive.c
+++ b/builtin-archive.c
{
const char *extra_argv[MAX_EXTRA_ARGS];
int extra_argc = 0;
- const char *format = NULL; /* might want to default to "tar" */
+ const char *format = "tar";
const char *base = "";
int verbose = 0;
int i;
/* We need at least one parameter -- tree-ish */
if (argc - 1 < i)
usage(archive_usage);
- if (!format)
- die("You must specify an archive format");
if (init_archiver(format, ar) < 0)
die("Unknown archive format '%s'", format);
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index b4359df795483691e61452366add69a212347723..e223c074f043571ff868a2f4783c7cc155185004 100755 (executable)
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
git-update-ref HEAD $(TZ=GMT GIT_COMMITTER_DATE="2005-05-27 22:00:00" \
git-commit-tree $treeid </dev/null)'
+test_expect_success \
+ 'git-archive' \
+ 'git-archive HEAD >b.tar'
+
test_expect_success \
'git-tar-tree' \
- 'git-tar-tree HEAD >b.tar'
+ 'git-tar-tree HEAD >b2.tar'
+
+test_expect_success \
+ 'git-archive vs. git-tar-tree' \
+ 'diff b.tar b2.tar'
test_expect_success \
'validate file modification time' \