Skip to content
Permalink
Browse files
git-webrev: use HEAD when branch has no commits
Reviewed-by: rwestberg
  • Loading branch information
edvbld committed Mar 11, 2020
1 parent a2a2237 commit d0eb79704c7b0516beea0abd3688c01fac5a41af
Showing 1 changed file with 5 additions and 1 deletion.
@@ -212,7 +212,11 @@ private static void generate(String[] args) throws IOException {
rev = resolve(repo, "HEAD");
} else {
var commits = repo.commitMetadata("origin..HEAD", true);
rev = resolve(repo, commits.get(0).hash().hex() + "^");
if (commits.isEmpty()) {
rev = resolve(repo, "HEAD");
} else {
rev = resolve(repo, commits.get(0).hash().hex() + "^");
}
}
}
}

0 comments on commit d0eb797

Please sign in to comment.