summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d84029b)
raw | patch | inline | side by side (parent: d84029b)
author | Junio C Hamano <junkio@cox.net> | |
Mon, 8 Jan 2007 22:40:33 +0000 (14:40 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 8 Jan 2007 22:46:00 +0000 (14:46 -0800) |
There is no reason not to, really.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-pack-refs.txt | patch | blob | history | |
builtin-pack-refs.c | patch | blob | history | |
t/t3210-pack-refs.sh | patch | blob | history |
index 5da51057713a5553db26d871cc561b0df7ca94ff..464269fbb994dcee96bb08197c4f3d22fc0d4ad8 100644 (file)
SYNOPSIS
--------
-'git-pack-refs' [--all] [--prune]
+'git-pack-refs' [--all] [--no-prune]
DESCRIPTION
-----------
This option causes branch tips to be packed as well. Useful for
a repository with many branches of historical interests.
-\--prune::
+\--no-prune::
+
+The command usually removes loose refs under `$GIT_DIR/refs`
+hierarchy after packing them. This option tells it not to.
-After packing the refs, remove loose refs under `$GIT_DIR/refs`
-hierarchy. This should probably become default.
Author
------
diff --git a/builtin-pack-refs.c b/builtin-pack-refs.c
index 8dc5b9efffc3ad2cd56130155a94aa489d0d0b1b..6de7128b9d8e98dcb9850d9dc932ca522c97473a 100644 (file)
--- a/builtin-pack-refs.c
+++ b/builtin-pack-refs.c
#include "tag.h"
static const char builtin_pack_refs_usage[] =
-"git-pack-refs [--all] [--prune]";
+"git-pack-refs [--all] [--prune | --no-prune]";
struct ref_to_prune {
struct ref_to_prune *next;
memset(&cbdata, 0, sizeof(cbdata));
+ cbdata.prune = 1;
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
if (!strcmp(arg, "--prune")) {
- cbdata.prune = 1;
+ cbdata.prune = 1; /* now the default */
+ continue;
+ }
+ if (!strcmp(arg, "--no-prune")) {
+ cbdata.prune = 0;
continue;
}
if (!strcmp(arg, "--all")) {
diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh
index b1e9f2eed22b9938a6dbba89a98f6dcc9f2dded1..16bdae4f2377cd93a509ff0c74ac62cc00f0b619 100755 (executable)
--- a/t/t3210-pack-refs.sh
+++ b/t/t3210-pack-refs.sh
'see if a branch still exists when packed' \
'git-branch b &&
git-pack-refs --all &&
- rm .git/refs/heads/b &&
+ rm -f .git/refs/heads/b &&
echo "$SHA1 refs/heads/b" >expect &&
git-show-ref b >result &&
diff expect result'