projects
/
gitlive
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dafe091
)
GitBranch.vala
author
Alan Knowles
<alan@roojs.com>
Tue, 30 Oct 2018 07:21:45 +0000
(15:21 +0800)
committer
Alan Knowles
<alan@roojs.com>
Tue, 30 Oct 2018 07:21:45 +0000
(15:21 +0800)
GitBranch.vala
patch
|
blob
|
history
diff --git
a/GitBranch.vala
b/GitBranch.vala
index
755968e
..
d877551
100644
(file)
--- a/
GitBranch.vala
+++ b/
GitBranch.vala
@@
-8,10
+8,10
@@
public class GitBranch : Object
public GitRepo repo;
public bool active = false;
public GitRepo repo;
public bool active = false;
- public string lastrev;
- public string name;
- public string remote:
- public string remoterev;
+ public string lastrev
= ""
;
+ public string name
= ""
;
+ public string remote
= ""
:
+ public string remoterev
= ""
;
public GitBranch(GitRepo repo)
{
public GitBranch(GitRepo repo)
{
@@
-26,8
+26,16
@@
public class GitBranch : Object
this.active = str[0] == '*';
var bits = Regex.split_simple ("[ \t]+", str.substring(2).strip());
this.active = str[0] == '*';
var bits = Regex.split_simple ("[ \t]+", str.substring(2).strip());
-
+ if (bits[1] == "->") { // it's an alias.. eg. remotes/origin/HEAD -> origin/master..
+ return false;
+ }
+ this.lastrev = parts[1];
+ if (parts[0].has_prefix("remotes/")) {
+ this.remote = parts[0];
+ } else {
+ this.name = ""
+
}
\ No newline at end of file
}
\ No newline at end of file