MCPcopy Create free account
hub / github.com/git/git / wt_status_check_worktree_changes

Function wt_status_check_worktree_changes

wt-status.c:952–974  ·  view source on GitHub ↗

* -1 : has delete * 0 : no change * 1 : some change but no delete */

Source from the content-addressed store, hash-verified

950 * 1 : some change but no delete
951 */
952static int wt_status_check_worktree_changes(struct wt_status *s,
953 int *dirty_submodules)
954{
955 int i;
956 int changes = 0;
957
958 *dirty_submodules = 0;
959
960 for (i = 0; i < s->change.nr; i++) {
961 struct wt_status_change_data *d;
962 d = s->change.items[i].util;
963 if (!d->worktree_status ||
964 d->worktree_status == DIFF_STATUS_UNMERGED)
965 continue;
966 if (!changes)
967 changes = 1;
968 if (d->dirty_submodule)
969 *dirty_submodules = 1;
970 if (d->worktree_status == DIFF_STATUS_DELETED)
971 changes = -1;
972 }
973 return changes;
974}
975
976static void wt_longstatus_print_changed(struct wt_status *s)
977{

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected