summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5a32771)
raw | patch | inline | side by side (parent: 5a32771)
author | Junio C Hamano <junkio@cox.net> | |
Sat, 26 Nov 2005 08:50:02 +0000 (00:50 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 29 Nov 2005 07:13:02 +0000 (23:13 -0800) |
These commands are converted to run from a subdirectory.
commit-tree convert-objects merge-base merge-index mktag
pack-objects pack-redundant prune-packed read-tree tar-tree
unpack-file unpack-objects update-server-info write-tree
Signed-off-by: Junio C Hamano <junkio@cox.net>
commit-tree convert-objects merge-base merge-index mktag
pack-objects pack-redundant prune-packed read-tree tar-tree
unpack-file unpack-objects update-server-info write-tree
Signed-off-by: Junio C Hamano <junkio@cox.net>
14 files changed:
commit-tree.c | patch | blob | history | |
convert-objects.c | patch | blob | history | |
merge-base.c | patch | blob | history | |
merge-index.c | patch | blob | history | |
mktag.c | patch | blob | history | |
pack-objects.c | patch | blob | history | |
pack-redundant.c | patch | blob | history | |
prune-packed.c | patch | blob | history | |
read-tree.c | patch | blob | history | |
tar-tree.c | patch | blob | history | |
unpack-file.c | patch | blob | history | |
unpack-objects.c | patch | blob | history | |
update-server-info.c | patch | blob | history | |
write-tree.c | patch | blob | history |
diff --git a/commit-tree.c b/commit-tree.c
index b60299fed0442edec21f123e92774238d4533bea..4634b50e6aa8bb214da7ebf41d2a8cf34028f531 100644 (file)
--- a/commit-tree.c
+++ b/commit-tree.c
if (argc < 2 || get_sha1_hex(argv[1], tree_sha1) < 0)
usage(commit_tree_usage);
+ setup_git_directory();
+
check_valid(tree_sha1, "tree");
for (i = 2; i < argc; i += 2) {
char *a, *b;
diff --git a/convert-objects.c b/convert-objects.c
index a892013f0f37480fbf13a9511f2146d1681ba136..d78a8b4ae3af80a1207b0e8894ca55fe2363114b 100644 (file)
--- a/convert-objects.c
+++ b/convert-objects.c
unsigned char sha1[20];
struct entry *entry;
+ setup_git_directory();
+
if (argc != 2 || get_sha1(argv[1], sha1))
usage("git-convert-objects <sha1>");
diff --git a/merge-base.c b/merge-base.c
index 751c3c281b8803ccb83a9de99c3ab5d63039c377..e73fca7453e8141b3f371a1aeba483c9ed946ccc 100644 (file)
--- a/merge-base.c
+++ b/merge-base.c
struct commit *rev1, *rev2;
unsigned char rev1key[20], rev2key[20];
+ setup_git_directory();
+
while (1 < argc && argv[1][0] == '-') {
char *arg = argv[1];
if (!strcmp(arg, "-a") || !strcmp(arg, "--all"))
diff --git a/merge-index.c b/merge-index.c
index 727527fd59480a11a563108fa5d55a2696a40e98..024196e7ac53cb9ad09b38ea646bad81aff33306 100644 (file)
--- a/merge-index.c
+++ b/merge-index.c
if (argc < 3)
usage("git-merge-index [-o] [-q] <merge-program> (-a | <filename>*)");
+ setup_git_directory();
read_cache();
i = 1;
index 585677eb83cd0fd21963d21291a6af2b54fc9c84..97e270a5761f071aeb3666b595b5cd6a8cbd4098 100644 (file)
--- a/mktag.c
+++ b/mktag.c
if (argc != 1)
usage("cat <signaturefile> | git-mktag");
+ setup_git_directory();
+
// Read the signature
size = 0;
for (;;) {
diff --git a/pack-objects.c b/pack-objects.c
index 8864a31cc14f4c57fe0115a0bfe73904fdb1ae12..a62c9f8d185aabb9a719397ce6daeeaa61f6ce58 100644 (file)
--- a/pack-objects.c
+++ b/pack-objects.c
struct object_entry **list;
int i;
+ setup_git_directory();
+
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
diff --git a/pack-redundant.c b/pack-redundant.c
index 793fa08096e83e9a5504ca2bdc73b9b4d2a4dbbd..0a43278924edae9d6e3ecdf4bb100bea10faef97 100644 (file)
--- a/pack-redundant.c
+++ b/pack-redundant.c
unsigned char *sha1;
char buf[42]; /* 40 byte sha1 + \n + \0 */
+ setup_git_directory();
+
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
if(!strcmp(arg, "--")) {
diff --git a/prune-packed.c b/prune-packed.c
index 26123f7f6bb8bf9cc7fc27905fe2b67d66646f05..d24b097114ef2610416b106ea9aa2000873924f3 100644 (file)
--- a/prune-packed.c
+++ b/prune-packed.c
{
int i;
+ setup_git_directory();
+
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
diff --git a/read-tree.c b/read-tree.c
index df156ea0dad15ee810e8036442dfcab9202ef46a..e3b9c0d9fa1cb5a03d1a3a08f992074293285904 100644 (file)
--- a/read-tree.c
+++ b/read-tree.c
unsigned char sha1[20];
merge_fn_t fn = NULL;
+ setup_git_directory();
+
newfd = hold_index_file_for_update(&cache_file, get_index_file());
if (newfd < 0)
die("unable to create new cachefile");
diff --git a/tar-tree.c b/tar-tree.c
index 970c4bb54e148282a89f1249a96deca880bccafd..bacb23ae6365767dfdc93c6041aa9f3cb673b27b 100644 (file)
--- a/tar-tree.c
+++ b/tar-tree.c
void *buffer;
unsigned long size;
+ setup_git_directory();
+
switch (argc) {
case 3:
basedir = argv[2];
diff --git a/unpack-file.c b/unpack-file.c
index d4ac3a5460568408f96fc26e5228c639dfc20439..07303f8bb3ef2b93f3e7c9bbe116aef9660584d5 100644 (file)
--- a/unpack-file.c
+++ b/unpack-file.c
if (argc != 2 || get_sha1(argv[1], sha1))
usage("git-unpack-file <sha1>");
+ setup_git_directory();
+
puts(create_temp_file(sha1));
return 0;
}
diff --git a/unpack-objects.c b/unpack-objects.c
index 8490895cf02df538327fa79bc0b2ffff2f06bd84..cfd61ae6b08c0635da4044ec3ab09f40c3178632 100644 (file)
--- a/unpack-objects.c
+++ b/unpack-objects.c
int i;
unsigned char sha1[20];
+ setup_git_directory();
+
for (i = 1 ; i < argc; i++) {
const char *arg = argv[i];
diff --git a/update-server-info.c b/update-server-info.c
index e824f62eaff8121095191f4710354aefb63eba56..0b6c3835bd19241ff447c37f442de75791186020 100644 (file)
--- a/update-server-info.c
+++ b/update-server-info.c
if (i != ac)
usage(update_server_info_usage);
+ setup_git_directory();
+
return !!update_server_info(force);
}
diff --git a/write-tree.c b/write-tree.c
index 2b2c6b77afd53870423d4bad9191ed669bc55660..0aac32f2271760f3f576ca2979e61fbd1ba83794 100644 (file)
--- a/write-tree.c
+++ b/write-tree.c
int main(int argc, char **argv)
{
int i, funny;
- int entries = read_cache();
+ int entries;
unsigned char sha1[20];
+ setup_git_directory();
+
+ entries = read_cache();
if (argc == 2) {
if (!strcmp(argv[1], "--missing-ok"))
missing_ok = 1;