Skip to content

Commit

Permalink
Merge branch 'jk/status-read-branch-name-fix' into maint
Browse files Browse the repository at this point in the history
Code to read branch name from various files in .git/ directory
would have misbehaved if the code to write them left an empty file.

* jk/status-read-branch-name-fix:
  read_and_strip_branch: fix typo'd address-of operator
  • Loading branch information
gitster committed Feb 25, 2015
2 parents 2fc85f0 + 66ec904 commit 93baadb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wt-status.c
Expand Up @@ -1140,7 +1140,7 @@ static char *read_and_strip_branch(const char *path)
if (strbuf_read_file(&sb, git_path("%s", path), 0) <= 0)
goto got_nothing;

while (&sb.len && sb.buf[sb.len - 1] == '\n')
while (sb.len && sb.buf[sb.len - 1] == '\n')
strbuf_setlen(&sb, sb.len - 1);
if (!sb.len)
goto got_nothing;
Expand Down

0 comments on commit 93baadb

Please sign in to comment.