libgit2/src/checkout.h
Carlos Martín Nieto 62a617dc68 iterator: submodules are determined by an index or tree
We cannot know from looking at .gitmodules whether a directory is a
submodule or not. We need the index or tree we are comparing against to
tell us. Otherwise we have to assume the entry in .gitmodules is stale
or otherwise invalid.

Thus we pass the index of the repository into the workdir iterator, even
if we do not want to compare against it. This follows what git does,
which even for `git diff <tree>`, it will consider staged submodules as
such.
2014-11-07 08:33:27 +01:00

26 lines
687 B
C

/*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef INCLUDE_checkout_h__
#define INCLUDE_checkout_h__
#include "git2/checkout.h"
#include "iterator.h"
#define GIT_CHECKOUT__NOTIFY_CONFLICT_TREE (1u << 12)
/**
* Update the working directory to match the target iterator. The
* expected baseline value can be passed in via the checkout options
* or else will default to the HEAD commit.
*/
extern int git_checkout_iterator(
git_iterator *target,
git_index *index,
const git_checkout_options *opts);
#endif