RFR: 92: GitRepository::currentBranch fails when on a detached HEAD

Erik Helin ehelin at openjdk.java.net
Thu Nov 28 15:10:50 UTC 2019


Hi all,

please review this pull request that makes `git webrev` work when the repository is in a "detached HEAD" state (i.e. there is no active branch). The main part of the change is making `ReadOnlyRepository::currentBranch` return `Optional<Branch>` instead of `Branch`.

Thanks,
Erik

## Testing
- [x] `make test` on Linux x64
- [x] Manually running `git webrev` on a repository with a detached HEAD

----------------

Commits:
 - 3dc4fea9: 92: GitRepository::currentBranch fails when on a detached HEAD

Changes: https://git.openjdk.java.net/skara/pull/278/files
 Webrev: https://webrevs.openjdk.java.net/skara/278/webrev.00
  Issue: https://bugs.openjdk.java.net/browse/SKARA-92
  Stats: 40 lines in 8 files changed: 16 ins; 2 del; 22 mod
  Patch: https://git.openjdk.java.net/skara/pull/278.diff
  Fetch: git fetch https://git.openjdk.java.net/skara pull/278/head:pull/278

PR: https://git.openjdk.java.net/skara/pull/278


More information about the skara-dev mailing list