Merge branch 'maint'

* maint:
  Start 1.6.0.5 cycle
  Fix pack.packSizeLimit and --max-pack-size handling
  checkout: Fix "initial checkout" detection
  Remove the period after the git-check-attr summary

Conflicts:
	RelNotes
maint
Junio C Hamano 2008-11-12 15:03:57 -08:00
commit 6cd3729eae
8 changed files with 47 additions and 6 deletions

View File

@ -0,0 +1,21 @@
GIT v1.6.0.5 Release Notes
==========================

Fixes since v1.6.0.4
--------------------

* 'git checkout' used to crash when your HEAD was pointing at a deleted
branch.

* 'git checkout' from an un-checked-out state did not allow switching out
of the current branch.

* 'git pack-objects' did not make its best effort to honor --max-pack-size
option when a single first object already busted the given limit and
placed many objects in a single pack.

* 'make check' cannot be run without sparse; people may have meant to say
'make test' instead, so suggest that.

* Many unsafe call to sprintf() style varargs functions are corrected.

View File

@ -3,7 +3,7 @@ git-check-attr(1)


NAME NAME
---- ----
git-check-attr - Display gitattributes information. git-check-attr - Display gitattributes information




SYNOPSIS SYNOPSIS

View File

@ -397,8 +397,7 @@ static int merge_working_tree(struct checkout_opts *opts,
} }


/* 2-way merge to the new branch */ /* 2-way merge to the new branch */
topts.initial_checkout = (!active_nr && topts.initial_checkout = is_cache_unborn();
(old->commit == new->commit));
topts.update = 1; topts.update = 1;
topts.merge = 1; topts.merge = 1;
topts.gently = opts->merge; topts.gently = opts->merge;

View File

@ -245,8 +245,16 @@ static unsigned long write_object(struct sha1file *f,
type = entry->type; type = entry->type;


/* write limit if limited packsize and not first object */ /* write limit if limited packsize and not first object */
limit = pack_size_limit && nr_written ? if (!pack_size_limit || !nr_written)
pack_size_limit - write_offset : 0; limit = 0;
else if (pack_size_limit <= write_offset)
/*
* the earlier object did not fit the limit; avoid
* mistaking this with unlimited (i.e. limit = 0).
*/
limit = 1;
else
limit = pack_size_limit - write_offset;


if (!entry->delta) if (!entry->delta)
usable_delta = 0; /* no delta */ usable_delta = 0; /* no delta */

View File

@ -206,7 +206,7 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
break; break;
case 2: case 2:
opts.fn = twoway_merge; opts.fn = twoway_merge;
opts.initial_checkout = !active_nr; opts.initial_checkout = is_cache_unborn();
break; break;
case 3: case 3:
default: default:

View File

@ -262,6 +262,7 @@ static inline void remove_name_hash(struct cache_entry *ce)


#define read_cache() read_index(&the_index) #define read_cache() read_index(&the_index)
#define read_cache_from(path) read_index_from(&the_index, (path)) #define read_cache_from(path) read_index_from(&the_index, (path))
#define is_cache_unborn() is_index_unborn(&the_index)
#define read_cache_unmerged() read_index_unmerged(&the_index) #define read_cache_unmerged() read_index_unmerged(&the_index)
#define write_cache(newfd, cache, entries) write_index(&the_index, (newfd)) #define write_cache(newfd, cache, entries) write_index(&the_index, (newfd))
#define discard_cache() discard_index(&the_index) #define discard_cache() discard_index(&the_index)
@ -368,6 +369,7 @@ extern int init_db(const char *template_dir, unsigned int flags);
/* Initialize and use the cache information */ /* Initialize and use the cache information */
extern int read_index(struct index_state *); extern int read_index(struct index_state *);
extern int read_index_from(struct index_state *, const char *path); extern int read_index_from(struct index_state *, const char *path);
extern int is_index_unborn(struct index_state *);
extern int read_index_unmerged(struct index_state *); extern int read_index_unmerged(struct index_state *);
extern int write_index(const struct index_state *, int newfd); extern int write_index(const struct index_state *, int newfd);
extern int discard_index(struct index_state *); extern int discard_index(struct index_state *);

View File

@ -1269,6 +1269,11 @@ unmap:
die("index file corrupt"); die("index file corrupt");
} }


int is_index_unborn(struct index_state *istate)
{
return (!istate->cache_nr && !istate->alloc && !istate->timestamp);
}

int discard_index(struct index_state *istate) int discard_index(struct index_state *istate)
{ {
istate->cache_nr = 0; istate->cache_nr = 0;

View File

@ -376,4 +376,10 @@ test_expect_success 'index-pack with --strict' '
) )
' '


test_expect_success 'tolerate absurdly small packsizelimit' '
git config pack.packSizeLimit 2 &&
packname_9=$(git pack-objects test-9 <obj-list) &&
test $(wc -l <obj-list) = $(ls test-9-*.pack | wc -l)
'

test_done test_done