Commit 5e6f003
reflog_expire(): ignore --updateref for symbolic references
If we are expiring reflog entries for a symbolic reference, then how
should --updateref be handled if the newest reflog entry is expired?
Option 1: Update the referred-to reference. (This is what the current
code does.) This doesn't make sense, because the referred-to reference
has its own reflog, which hasn't been rewritten.
Option 2: Update the symbolic reference itself (as in, REF_NODEREF).
This would convert the symbolic reference into a non-symbolic
reference (e.g., detaching HEAD), which is surely not what a user
would expect.
Option 3: Error out. This is plausible, but it would make the
following usage impossible:
git reflog expire ... --updateref --all
Option 4: Ignore --updateref for symbolic references.
We choose to implement option 4.
Note: another problem in this code will be fixed in a moment.
Signed-off-by: Michael Haggerty <[email protected]>
Reviewed-by: Stefan Beller <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent fe2a181 commit 5e6f003
2 files changed
+14
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4029 | 4029 | | |
4030 | 4030 | | |
4031 | 4031 | | |
| 4032 | + | |
4032 | 4033 | | |
4033 | 4034 | | |
4034 | 4035 | | |
| |||
4040 | 4041 | | |
4041 | 4042 | | |
4042 | 4043 | | |
4043 | | - | |
| 4044 | + | |
4044 | 4045 | | |
4045 | 4046 | | |
4046 | 4047 | | |
| |||
4077 | 4078 | | |
4078 | 4079 | | |
4079 | 4080 | | |
| 4081 | + | |
| 4082 | + | |
| 4083 | + | |
| 4084 | + | |
| 4085 | + | |
| 4086 | + | |
| 4087 | + | |
| 4088 | + | |
4080 | 4089 | | |
4081 | 4090 | | |
4082 | 4091 | | |
4083 | | - | |
| 4092 | + | |
4084 | 4093 | | |
4085 | 4094 | | |
4086 | 4095 | | |
| |||
4091 | 4100 | | |
4092 | 4101 | | |
4093 | 4102 | | |
4094 | | - | |
| 4103 | + | |
4095 | 4104 | | |
4096 | 4105 | | |
4097 | 4106 | | |
| |||
0 commit comments