Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
objective-git/ObjectiveGit/GTRepository+Status.h at master · libgit2/objective-git · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
libgit2
objective-git
Repository navigation
Code
Issues
27
(27)
Pull requests
10
(10)
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
objective-git
/
ObjectiveGit
/
GTRepository+Status.h
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
148 lines (126 loc) · 6.8 KB
master
Breadcrumbs
objective-git
/
ObjectiveGit
/
GTRepository+Status.h
Copy path
Top
File metadata and controls
Code
Blame
148 lines (126 loc) · 6.8 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
//
//
GTRepository+Status.h
//
ObjectiveGitFramework
//
//
Created by Danny Greg on 08/08/2013.
//
Copyright (c) 2013 GitHub, Inc. All rights reserved.
//
#
import
"
GTRepository.h
"
#
import
"
git2/status.h
"
@class
GTStatusDelta;
NS_ASSUME_NONNULL_BEGIN
//
/ An enum representing the status of a file
//
/ See git_status_t
typedef
NS_OPTIONS
(
NSInteger
, GTFileStatusFlags) {
GTFileStatusCurrent =
GIT_STATUS_CURRENT
,
GTFileStatusNewInIndex =
GIT_STATUS_INDEX_NEW
,
GTFileStatusModifiedInIndex =
GIT_STATUS_INDEX_MODIFIED
,
GTFileStatusDeletedInIndex =
GIT_STATUS_INDEX_DELETED
,
GTFileStatusRenamedInIndex =
GIT_STATUS_INDEX_RENAMED
,
GTFileStatusTypeChangedInIndex =
GIT_STATUS_INDEX_TYPECHANGE
,
GTFileStatusNewInWorktree =
GIT_STATUS_WT_NEW
,
GTFileStatusModifiedInWorktree =
GIT_STATUS_WT_MODIFIED
,
GTFileStatusDeletedInWorktree =
GIT_STATUS_WT_DELETED
,
GTFileStatusTypeChangedInWorktree =
GIT_STATUS_WT_TYPECHANGE
,
GTFileStatusRenamedInWorktree =
GIT_STATUS_WT_RENAMED
,
GTFileStatusIgnored =
GIT_STATUS_IGNORED
,
};
//
/ An `NSNumber` wrapped `GTRepositoryStatusOptionsShow` bitmask.
//
/
//
/ For extending the reporting of status. Using the flags documented below this
//
/ decides what files are sent when enumerating the status.
extern
NSString
*
const
GTRepositoryStatusOptionsShowKey;
//
/ An enum, for use as documented, with the `GTRepositoryStatusOptionsShowKey`
//
/ key.
//
/
//
/ See status.h for documentation of each individual flag.
typedef
enum
{
GTRepositoryStatusOptionsShowIndexAndWorkingDirectory =
GIT_STATUS_SHOW_INDEX_AND_WORKDIR
,
GTRepositoryStatusOptionsShowIndexOnly =
GIT_STATUS_SHOW_INDEX_ONLY
,
GTRepositoryStatusOptionsShowWorkingDirectoryOnly =
GIT_STATUS_SHOW_WORKDIR_ONLY
,
} GTRepositoryStatusOptionsShow;
//
/ An `NSNumber` wrapped `GTRepositoryStatusOptionsFlags` bitmask containing
//
/ any of the flags documented below.
extern
NSString
*
const
GTRepositoryStatusOptionsFlagsKey;
//
/ An enum, for use as documented, with the `GTRepositoryStatusOptionsFlagsKey`
//
/ key.
//
/
//
/ See status.h for documentation of each individual flag.
typedef
enum
{
GTRepositoryStatusFlagsIncludeUntracked =
GIT_STATUS_OPT_INCLUDE_UNTRACKED
,
GTRepositoryStatusFlagsIncludeIgnored =
GIT_STATUS_OPT_INCLUDE_IGNORED
,
GTRepositoryStatusFlagsIncludeUnmodified =
GIT_STATUS_OPT_INCLUDE_UNMODIFIED
,
GTRepositoryStatusFlagsExcludeSubmodules =
GIT_STATUS_OPT_EXCLUDE_SUBMODULES
,
GTRepositoryStatusFlagsRecurseUntrackedDirectories =
GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS
,
GTRepositoryStatusFlagsDisablePathspecMatch =
GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH
,
GTRepositoryStatusFlagsRecurseIgnoredDirectories =
GIT_STATUS_OPT_RECURSE_IGNORED_DIRS
,
GTRepositoryStatusFlagsRenamesHeadToIndex =
GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX
,
GTRepositoryStatusFlagsRenamesIndexToWorkingDirectory =
GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR
,
GTRepositoryStatusFlagsRenamesFromRewrites =
GIT_STATUS_OPT_RENAMES_FROM_REWRITES
,
GTRepositoryStatusFlagsSortCaseSensitively =
GIT_STATUS_OPT_SORT_CASE_SENSITIVELY
,
GTRepositoryStatusFlagsSortCaseInsensitively =
GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY
,
GTRepositoryStatusFlagsIncludeUnreadable =
GIT_STATUS_OPT_INCLUDE_UNREADABLE
,
GTRepositoryStatusFlagsIncludeUnreadableAsUntracked =
GIT_STATUS_OPT_INCLUDE_UNREADABLE_AS_UNTRACKED
,
} GTRepositoryStatusFlags;
//
/ An `NSArray` of `NSStrings`s to limit the status to specific paths inside
//
/ the repository. The entries in the array represent either single paths or
//
/ filename patterns with wildcard matching a la standard shell glob (see
//
/ http://linux.die.net/man/7/glob for wildcard matching rules).
//
/
//
/ Defaults to including all files.
extern
NSString
*
const
GTRepositoryStatusOptionsPathSpecArrayKey;
@interface
GTRepository
(Status)
//
/ `YES` if the working directory has no modified, new, or deleted files.
@property
(
nonatomic
,
readonly
,
getter
= isWorkingDirectoryClean)
BOOL
workingDirectoryClean;
//
/ For each file in the repository, calls your block with the URL of the file
//
/ and the status of that file in the repository.
//
/
//
/ This will show all file statuses unless a pathspec is specified in the
//
/ options dictionary (using the `GTRepositoryStatusOptionsPathSpecArrayKey`
//
/ key).
//
/
//
/ options - A dictionary of options using the constants above
//
/ for keys. If no flags are passed in using
//
/ `GTRepositoryStatusOptionsFlagsKey` the defaults of
//
/ GTRepositoryStatusOptionsFlagsIncludeIgnored,
//
/ GTRepositoryStatusOptionsFlagsIncludeUntracked and
//
/ GTRepositoryStatusOptionsFlagsRecurseUntrackedDirectories
//
/ are used.
//
/ error - Will optionally be set in the event of a failure.
//
/ block - The block that gets called for each file.
//
/ `headToIndex` is the delta between the HEAD and
//
/ index. `indexToWorkingDirectory` is the same but
//
/ between the index and the working directory. If
//
/ `stop` is set to `YES`, the iteration will cease
//
/ after the current step.
//
/ Must not be nil.
//
/
//
/ Returns `NO` in case of a failure or `YES` if the enumeration completed
//
/ successfully.
- (
BOOL
)
enumerateFileStatusWithOptions
:
(
NSDictionary
* _Nullable)
options
error
:
(
NSError
**)
error
usingBlock
:
(
void
(^ _Nullable)(GTStatusDelta * _Nullable headToIndex, GTStatusDelta * _Nullable indexToWorkingDirectory,
BOOL
*stop))
block
;
//
/ Query the status of one file
//
/
//
/ filePath - A string path relative to the working copy. The must not be nil.
//
/ success - If not NULL, will be set to indicate success or fail.
//
/ error - If not nil, set to any error that occurs.
//
/
//
/ Returns the combined GTFileStatusFlags for the file.
- (GTFileStatusFlags)
statusForFile
:
(
NSString
*)
filePath
success
:
(
BOOL
* _Nullable)
success
error
:
(
NSError
**)
error
;
//
/ Tests the ignore rules to see if the file should be considered as ignored.
//
/
//
/ fileURL - A local file URL for a file in the repository. Must not be nil.
//
/ success - If not NULL, will be set to indicate success or fail.
//
/ error - If not nil, set to any error that occurs.
//
/
//
/ Returns YES if the file should be ignored; NO otherwise.
- (
BOOL
)
shouldFileBeIgnored
:
(
NSURL
*)
fileURL
success
:
(
BOOL
* _Nullable)
success
error
:
(
NSError
**)
error
;
//
/ An enum for use with shouldIgnoreFileURL:error: below
typedef
NS_ENUM
(
NSInteger
, GTFileIgnoreState) {
GTFileIgnoreStateIgnoreCheckFailed = -
1
,
GTFileIgnoreStateShouldNotIgnore =
0
,
GTFileIgnoreStateShouldIgnore =
1
};
//
/ Convenience wrapper for shouldFileBeIgnored:success:error:
- (GTFileIgnoreState)
shouldIgnoreFileURL
:
(
NSURL
*)
fileURL
error
:
(
NSError
**)
error
;
@end
NS_ASSUME_NONNULL_END
You can’t perform that action at this time.