summaryrefslogtreecommitdiff
path: root/remote.h
diff options
context:
space:
mode:
authorJeff Hostetler <jeffhost@microsoft.com>2018-01-09 18:50:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-01-24 21:48:38 (GMT)
commitd7d1b496aeea5a151c826683ed28c57ef0ac9389 (patch)
tree39f8418293a7f36f2d28785e2285d56df026d1b0 /remote.h
parent1eaabe34fc6f486367a176207420378f587d3b48 (diff)
downloadgit-d7d1b496aeea5a151c826683ed28c57ef0ac9389.zip
git-d7d1b496aeea5a151c826683ed28c57ef0ac9389.tar.gz
git-d7d1b496aeea5a151c826683ed28c57ef0ac9389.tar.bz2
stat_tracking_info: return +1 when branches not equal
Extend stat_tracking_info() to return +1 when branches are not equal and to take a new "enum ahead_behind_flags" argument to allow skipping the (possibly expensive) ahead/behind computation. This will be used in the next commit to allow "git status" to avoid full ahead/behind calculations for performance reasons. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote.h')
-rw-r--r--remote.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/remote.h b/remote.h
index 1f6611b..80240f0 100644
--- a/remote.h
+++ b/remote.h
@@ -257,9 +257,15 @@ enum match_refs_flags {
MATCH_REFS_FOLLOW_TAGS = (1 << 3)
};
+/* Flags for --ahead-behind option. */
+enum ahead_behind_flags {
+ AHEAD_BEHIND_QUICK = 0, /* just eq/neq reporting */
+ AHEAD_BEHIND_FULL = 1, /* traditional a/b reporting */
+};
+
/* Reporting of tracking info */
int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs,
- const char **upstream_name);
+ const char **upstream_name, enum ahead_behind_flags abf);
int format_tracking_info(struct branch *branch, struct strbuf *sb);
struct ref *get_local_heads(void);