From: Junio C Hamano Date: Wed, 1 Nov 2006 16:48:50 +0000 (-0800) Subject: Merge branch 'lj/refs' X-Git-Tag: v1.4.4-rc1~44 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=58a1e0e83bcdbf063fb708ee9a8a563c0aa14f87;p=git.git Merge branch 'lj/refs' * lj/refs: (63 commits) Fix show-ref usagestring t3200: git-branch testsuite update sha1_name.c: avoid compilation warnings. Make git-branch a builtin ref-log: fix D/F conflict coming from deleted refs. git-revert with conflicts to behave as git-merge with conflicts core.logallrefupdates thinko-fix git-pack-refs --all core.logallrefupdates create new log file only for branch heads. Remove bashism from t3210-pack-refs.sh ref-log: allow ref@{count} syntax. pack-refs: call fflush before fsync. pack-refs: use lockfile as everybody else does. git-fetch: do not look into $GIT_DIR/refs to see if a tag exists. lock_ref_sha1_basic does not remove empty directories on BSD Do not create tag leading directories since git update-ref does it. Check that a tag exists using show-ref instead of looking for the ref file. Use git-update-ref to delete a tag instead of rm()ing the ref file. Fix refs.c;:repack_without_ref() clean-up path Clean up "git-branch.sh" and add remove recursive dir test cases. ... --- 58a1e0e83bcdbf063fb708ee9a8a563c0aa14f87 diff --cc Makefile index 2d62efb5c,be8bf392a..40e2a680f --- a/Makefile +++ b/Makefile @@@ -267,9 -265,9 +267,10 @@@ LIB_OBJS = BUILTIN_OBJS = \ builtin-add.o \ + builtin-annotate.o \ builtin-apply.o \ builtin-archive.o \ + builtin-branch.o \ builtin-cat-file.o \ builtin-checkout-index.o \ builtin-check-ref-format.o \ diff --cc builtin.h index 708a2f22e,db9b369e2..f7150aa6b --- a/builtin.h +++ b/builtin.h @@@ -11,12 -11,11 +11,13 @@@ extern int mailinfo(FILE *in, FILE *out extern int split_mbox(const char **mbox, const char *dir, int allow_bare, int nr_prec, int skip); extern void stripspace(FILE *in, FILE *out); extern int write_tree(unsigned char *sha1, int missing_ok, const char *prefix); +extern void prune_packed_objects(int); extern int cmd_add(int argc, const char **argv, const char *prefix); +extern int cmd_annotate(int argc, const char **argv, const char *prefix); extern int cmd_apply(int argc, const char **argv, const char *prefix); extern int cmd_archive(int argc, const char **argv, const char *prefix); + extern int cmd_branch(int argc, const char **argv, const char *prefix); extern int cmd_cat_file(int argc, const char **argv, const char *prefix); extern int cmd_checkout_index(int argc, const char **argv, const char *prefix); extern int cmd_check_ref_format(int argc, const char **argv, const char *prefix); diff --cc git.c index 6475847b7,f197169df..af181d93b --- a/git.c +++ b/git.c @@@ -219,9 -219,9 +219,10 @@@ static void handle_internal_command(in int option; } commands[] = { { "add", cmd_add, RUN_SETUP }, + { "annotate", cmd_annotate, }, { "apply", cmd_apply }, { "archive", cmd_archive }, + { "branch", cmd_branch }, { "cat-file", cmd_cat_file, RUN_SETUP }, { "checkout-index", cmd_checkout_index, RUN_SETUP }, { "check-ref-format", cmd_check_ref_format }, diff --cc receive-pack.c index f2b1c29bd,1fcf3a911..de1d6a4b1 --- a/receive-pack.c +++ b/receive-pack.c @@@ -15,20 -14,7 +15,20 @@@ static int report_status static char capabilities[] = "report-status"; static int capabilities_sent; +static int receive_pack_config(const char *var, const char *value) +{ + git_default_config(var, value); + + if (strcmp(var, "receive.denynonfastforwards") == 0) + { + deny_non_fast_forwards = git_config_bool(var, value); + return 0; + } + + return 0; +} + - static int show_ref(const char *path, const unsigned char *sha1) + static int show_ref(const char *path, const unsigned char *sha1, int flag, void *cb_data) { if (capabilities_sent) packet_write(1, "%s %s\n", sha1_to_hex(sha1), path); @@@ -349,10 -275,11 +289,11 @@@ int main(int argc, char **argv if (!dir) usage(receive_pack_usage); - if(!enter_repo(dir, 0)) + if (!enter_repo(dir, 0)) die("'%s': unable to chdir or not a git archive", dir); + setup_ident(); - git_config(git_default_config); + git_config(receive_pack_config); write_head_info(); diff --cc upload-pack.c index 9ec377504,9412a9b26..ddaa72f0a --- a/upload-pack.c +++ b/upload-pack.c @@@ -420,9 -416,9 +420,9 @@@ static void receive_needs(void } } - static int send_ref(const char *refname, const unsigned char *sha1) + static int send_ref(const char *refname, const unsigned char *sha1, int flag, void *cb_data) { - static const char *capabilities = "multi_ack thin-pack side-band side-band-64k"; + static const char *capabilities = "multi_ack thin-pack side-band side-band-64k ofs-delta"; struct object *o = parse_object(sha1); if (!o)