forked from livegrep/livegrep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit_indexer.h
43 lines (38 loc) · 1.17 KB
/
git_indexer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/********************************************************************
* livegrep -- git_indexer.h
* Copyright (c) 2011-2013 Nelson Elhage
*
* This program is free software. You may use, redistribute, and/or
* modify it under the terms listed in the COPYING file.
********************************************************************/
#ifndef CODESEARCH_GIT_INDEXER_H
#define CODESEARCH_GIT_INDEXER_H
#include <string>
#include "src/proto/config.pb.h"
class code_searcher;
class git_repository;
class git_tree;
struct indexed_tree;
class git_indexer {
public:
git_indexer(code_searcher *cs,
const std::string& repopath,
const std::string& name,
const Metadata &metadata,
bool walk_submodules);
~git_indexer();
void walk(const std::string& ref);
protected:
void walk_tree(const std::string& pfx,
const std::string& order,
git_tree *tree);
code_searcher *cs_;
git_repository *repo_;
const indexed_tree *idx_tree_;
std::string repopath_;
std::string name_;
Metadata metadata_;
bool walk_submodules_;
std::string submodule_prefix_;
};
#endif