Merge branch 'sigar-1.6'
This commit is contained in:
commit
cf22b7f0a1
|
@ -177,8 +177,18 @@ public class ArchNameTask extends Task {
|
||||||
String head = readLine(git + "/HEAD");
|
String head = readLine(git + "/HEAD");
|
||||||
|
|
||||||
if (head != null) {
|
if (head != null) {
|
||||||
String ref = head.substring(5).trim(); //'ref: '
|
String sha1;
|
||||||
return readLine(git + "/" + ref).substring(0, 7);
|
final String refp = "ref: ";
|
||||||
|
if (head.startsWith(refp)) {
|
||||||
|
//branch
|
||||||
|
String ref = head.substring(refp.length()).trim();
|
||||||
|
sha1 = readLine(git + "/" + ref);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//git checkout -f origin/branch-name (no branch)
|
||||||
|
sha1 = head;
|
||||||
|
}
|
||||||
|
return sha1.substring(0, 7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue