-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Return int from non-free functions #5365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9893d37
git_attr_cache_flush: return an int
ethomson 2e8c3b0
oid functions: return an int
ethomson 3351506
tree functions: return an int
ethomson 82154e5
remote functions: return an int
ethomson cb43274
index functions: return an int
ethomson a3126a7
repository functions: return an int
ethomson 82050fa
mempack functions: return an int
ethomson 4b331f0
revwalk functions: return an int
ethomson f78f6bd
error functions: return an int
ethomson 4cae9e7
git_libgit2_version: return an int
ethomson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -539,13 +539,19 @@ int git_index_clear(git_index *index) | |
git_idxmap_clear(index->entries_map); | ||
while (!error && index->entries.length > 0) | ||
error = index_remove_entry(index, index->entries.length - 1); | ||
|
||
if (error) | ||
goto done; | ||
|
||
index_free_deleted(index); | ||
|
||
git_index_reuc_clear(index); | ||
git_index_name_clear(index); | ||
if ((error = git_index_name_clear(index)) < 0 || | ||
(error = git_index_reuc_clear(index)) < 0) | ||
goto done; | ||
|
||
git_futils_filestamp_set(&index->stamp, NULL); | ||
|
||
done: | ||
return error; | ||
} | ||
|
||
|
@@ -2136,7 +2142,7 @@ int git_index_name_add(git_index *index, | |
return 0; | ||
} | ||
|
||
void git_index_name_clear(git_index *index) | ||
int git_index_name_clear(git_index *index) | ||
{ | ||
size_t i; | ||
git_index_name_entry *conflict_name; | ||
|
@@ -2149,6 +2155,8 @@ void git_index_name_clear(git_index *index) | |
git_vector_clear(&index->names); | ||
|
||
index->dirty = 1; | ||
|
||
return 0; | ||
} | ||
|
||
size_t git_index_reuc_entrycount(git_index *index) | ||
|
@@ -2245,7 +2253,7 @@ int git_index_reuc_remove(git_index *index, size_t position) | |
return error; | ||
} | ||
|
||
void git_index_reuc_clear(git_index *index) | ||
int git_index_reuc_clear(git_index *index) | ||
{ | ||
size_t i; | ||
|
||
|
@@ -2257,6 +2265,8 @@ void git_index_reuc_clear(git_index *index) | |
git_vector_clear(&index->reuc); | ||
|
||
index->dirty = 1; | ||
|
||
return 0; | ||
} | ||
|
||
static int index_error_invalid(const char *message) | ||
|
@@ -3277,8 +3287,9 @@ static int git_index_read_iterator( | |
} | ||
} | ||
|
||
git_index_name_clear(index); | ||
git_index_reuc_clear(index); | ||
if ((error = git_index_name_clear(index)) < 0 || | ||
(error = git_index_reuc_clear(index)) < 0) | ||
goto done; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here as well |
||
|
||
git_vector_swap(&new_entries, &index->entries); | ||
new_entries_map = git__swap(index->entries_map, new_entries_map); | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: indentation