File indexing completed on 2025-03-09 05:11:41

0001 /*
0002 SPDX-FileCopyrightText: 2021 Hamed Masafi <hamed.masfi@gmail.com>
0003 
0004 SPDX-License-Identifier: GPL-3.0-or-later
0005 */
0006 
0007 #include "index.h"
0008 
0009 #include "types.h"
0010 
0011 #include <git2/index.h>
0012 
0013 namespace Git
0014 {
0015 
0016 Index::Index(git_index *index)
0017     : ptr{index}
0018 {
0019 }
0020 
0021 bool Index::addByPath(const QString &path) const
0022 {
0023     return !git_index_add_bypath(ptr, toConstChars(path));
0024 }
0025 
0026 bool Index::removeByPath(const QString &path) const
0027 {
0028     return !git_index_remove_bypath(ptr, toConstChars(path));
0029 }
0030 
0031 }