summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Koutcher <thomas.koutcher@online.fr>2024-03-09 11:15:00 +0100
committerThomas Koutcher <thomas.koutcher@online.fr>2024-03-23 15:10:36 +0100
commit3c2cdb438a42a03d3ea06c522854829db459a993 (patch)
treeea1f953e40eea97c1a50230f695b58e0d19edc13
parente62abd9d3113310d3fea396cb6b54ed988020185 (diff)
Reset state variables when selecting a commit with no reference
-rw-r--r--NEWS.adoc1
-rw-r--r--src/main.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/NEWS.adoc b/NEWS.adoc
index 82c3d39d..a018b855 100644
--- a/NEWS.adoc
+++ b/NEWS.adoc
@@ -30,6 +30,7 @@ Bug fixes:
- Fix tig blame --reverse. (#1300)
- Fix status view lockup.
- Fix untracked changes and chunk staging behaviour in plain stage view.
+ - Reset state variables when selecting a commit with no reference.
tig-2.5.8
---------
diff --git a/src/main.c b/src/main.c
index f1c19144..9533356e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -630,6 +630,8 @@ main_select(struct view *view, struct line *line)
}
if (ref)
ref_update_env(view->env, ref, true);
+ else
+ view->env->tag[0] = view->env->remote[0] = view->env->branch[0] = view->env->refname[0] = 0;
}
string_copy_rev(view->env->commit, commit->id);
}