@@ -59,15 +59,19 @@ fn main() {
5959 }
6060 } ;
6161
62- // Get the branch to show in the browser. If the option is given, then, the
63- // value will be used, else, the current branch is given, or master if
64- // something went wrong.
65- let branch = match opt. branch {
66- Some ( branch) => branch,
67- None => {
68- logger. verbose_print ( "No branch given, getting current one" ) ;
69-
70- git:: get_branch ( & repo, & logger)
62+ // Get the tag to show in the browser. If the option is given, then the value
63+ // will be used as it is an alias for branch.
64+ let reference = if let Some ( tag) = opt. tag { tag } else {
65+ // Get the branch to show in the browser. If the option is given, then, the
66+ // value will be used, else, the current branch is given, or master if
67+ // something went wrong.
68+ match opt. branch {
69+ Some ( branch) => branch,
70+ None => {
71+ logger. verbose_print ( "No branch given, getting current one" ) ;
72+
73+ git:: get_branch ( & repo, & logger)
74+ }
7175 }
7276 } ;
7377
@@ -105,11 +109,11 @@ fn main() {
105109 )
106110 } else {
107111 format ! (
108- "https://{domain}/{repository}/{path}/{branch }" ,
112+ "https://{domain}/{repository}/{path}/{reference }" ,
109113 domain = parts. 0 ,
110114 path = if parts. 0 == BITBUCKET_HOSTNAME { "src" } else { "tree" } ,
111115 repository = parts. 1 ,
112- branch = branch
116+ reference = reference
113117 )
114118 } ;
115119
0 commit comments