Skip to content

Commit 26e0bd4

Browse files
authored
Merge pull request libgit2#6806 from libgit2/ethomson/fetch_opts
remote: drop bitfields in git_remote_fetch_options
2 parents 8791a26 + 2d649cc commit 26e0bd4

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

include/git2/remote.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -746,8 +746,7 @@ typedef struct {
746746
/**
747747
* How to handle reference updates; see `git_remote_update_flags`.
748748
*/
749-
unsigned int update_fetchhead : 1,
750-
report_unchanged : 1;
749+
unsigned int update_fetchhead;
751750

752751
/**
753752
* Determines how to behave regarding tags on the remote, such
@@ -790,8 +789,7 @@ typedef struct {
790789
GIT_FETCH_OPTIONS_VERSION, \
791790
GIT_REMOTE_CALLBACKS_INIT, \
792791
GIT_FETCH_PRUNE_UNSPECIFIED, \
793-
1, \
794-
0, \
792+
GIT_REMOTE_UPDATE_FETCHHEAD, \
795793
GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED, \
796794
GIT_PROXY_OPTIONS_INIT }
797795

src/libgit2/remote.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,12 +1376,7 @@ int git_remote_fetch(
13761376
return error;
13771377

13781378
if (opts) {
1379-
if (opts->update_fetchhead)
1380-
update_flags |= GIT_REMOTE_UPDATE_FETCHHEAD;
1381-
1382-
if (opts->report_unchanged)
1383-
update_flags |= GIT_REMOTE_UPDATE_REPORT_UNCHANGED;
1384-
1379+
update_flags = opts->update_fetchhead;
13851380
tagopt = opts->download_tags;
13861381
}
13871382

0 commit comments

Comments
 (0)