Commit e34f9ed6ad6d7e550cdfa067e0e45300e232bfb7

Stefan Sperling 2019-02-02T15:07:38

in 'got log' output, abbreviate ref names under heads/

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