Commit 141c2bffb4db6a2d0f6eec869b8eefe61b5deedf

Stefan Sperling 2019-02-04T09:55:45

abbreviate remote refs in output of 'got log'

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/got/got.c b/got/got.c
index 7b9991e..ee35492 100644
--- a/got/got.c
+++ b/got/got.c
@@ -631,6 +631,8 @@ print_commit(struct got_commit_object *commit, struct got_object_id *id,
 			name += 5;
 		if (strncmp(name, "heads/", 6) == 0)
 			name += 6;
+		if (strncmp(name, "remotes/", 8) == 0)
+			name += 8;
 		s = refs_str;
 		if (asprintf(&refs_str, "%s%s%s", s ? s : "", s ? ", " : "",
 		    name) == -1) {