зеркало из https://github.com/microsoft/git.git
gvfs: add the feature that blobs may be missing
Signed-off-by: Kevin Willford <kewillf@microsoft.com>
This commit is contained in:
Родитель
10eecbfe76
Коммит
104749a85c
|
@ -737,6 +737,10 @@ core.gvfs::
|
|||
GVFS_SKIP_SHA_ON_INDEX::
|
||||
Bit value 1
|
||||
Disables the calculation of the sha when writing the index
|
||||
GVFS_MISSING_OK::
|
||||
Bit value 4
|
||||
Normally git write-tree ensures that the objects referenced by the
|
||||
directory exist in the object database. This option disables this check.
|
||||
--
|
||||
|
||||
core.sparseCheckout::
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "cache.h"
|
||||
#include "gvfs.h"
|
||||
#include "lockfile.h"
|
||||
#include "tree.h"
|
||||
#include "tree-walk.h"
|
||||
|
@ -252,7 +253,8 @@ static int update_one(struct cache_tree *it,
|
|||
int flags)
|
||||
{
|
||||
struct strbuf buffer;
|
||||
int missing_ok = flags & WRITE_TREE_MISSING_OK;
|
||||
int missing_ok = gvfs_config_is_set(GVFS_MISSING_OK) ?
|
||||
WRITE_TREE_MISSING_OK : (flags & WRITE_TREE_MISSING_OK);
|
||||
int dryrun = flags & WRITE_TREE_DRY_RUN;
|
||||
int repair = flags & WRITE_TREE_REPAIR;
|
||||
int to_invalidate = 0;
|
||||
|
|
1
gvfs.h
1
gvfs.h
|
@ -14,6 +14,7 @@
|
|||
* The list of bits in the core_gvfs setting
|
||||
*/
|
||||
#define GVFS_SKIP_SHA_ON_INDEX (1 << 0)
|
||||
#define GVFS_MISSING_OK (1 << 2)
|
||||
|
||||
static inline int gvfs_config_is_set(int mask) {
|
||||
return (core_gvfs & mask) == mask;
|
||||
|
|
|
@ -1105,6 +1105,11 @@ test_expect_success 'writing this tree with --missing-ok' '
|
|||
git write-tree --missing-ok
|
||||
'
|
||||
|
||||
test_expect_success 'writing this tree with missing ok config value' '
|
||||
git config core.gvfs 4 &&
|
||||
git write-tree
|
||||
'
|
||||
|
||||
|
||||
################################################################
|
||||
test_expect_success 'git read-tree followed by write-tree should be idempotent' '
|
||||
|
|
Загрузка…
Ссылка в новой задаче