summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-12-07 17:44:25 +0000
committerGitHub <noreply@github.com>2016-12-07 17:44:25 +0000
commit8339c66068c8e964f8bf1eca10745db730bf62fa (patch)
tree90c4dcd70d32f52b3941c3b9b0e0bc1143128574 /src
parent15769731a2411933bb9236d06c5f15e2c4e7929b (diff)
parent4db1fc7e5ead5c29ffb6594b229b84f4392b40f1 (diff)
downloadlibgit2-8339c66068c8e964f8bf1eca10745db730bf62fa.tar.gz
Merge pull request #4020 from novalis/rebase-detached
git_rebase_init: correctly handle detached HEAD
Diffstat (limited to 'src')
-rw-r--r--src/rebase.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rebase.c b/src/rebase.c
index e86312e7e..0af2b3cf4 100644
--- a/src/rebase.c
+++ b/src/rebase.c
@@ -630,7 +630,7 @@ static int rebase_init_merge(
rebase->state_path = git_buf_detach(&state_path);
GITERR_CHECK_ALLOC(rebase->state_path);
- if (branch->ref_name) {
+ if (branch->ref_name && strcmp(branch->ref_name, "HEAD")) {
rebase->orig_head_name = git__strdup(branch->ref_name);
GITERR_CHECK_ALLOC(rebase->orig_head_name);
} else {